简体   繁体   中英

Zend Framework: SetIntegrityCheck(false) and then update the object

I am getting data from two tables using join and putting setIntegrityCheck(false) in my model. Now I need to call save() on that object. I know when you put setIntegrityCheck(false) , you cannot call save() , delete() or update() to this object. I have seen this question, but it doesn't address the answer.

So any way around?

ZF supports only Table data gateway and row data gateway pattern. AFAIK setIntegrityCheck() will only allow you to join tables within Db_Table_Select which will help you to build SQL query. Anyway you can not hydrate custom SQL results to Db_Table_Row objects - which supports save() . You have to simply update each row separatly. For more sofisticated approach you will have to use data mapper pattern - like Doctrine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM