简体   繁体   中英

How to remove a specific condition on the where clause (zend framework)?

I have the following query generated by the default library of a third party framework

SELECT COUNT(*) AS "total_rows" FROM "papers" WHERE (papers.paper_trash=0 OR papers.paper_trash IS NULL) AND (paper_category_id='7') AND (qtdavaliacoes='0')

I know that if I use a $query->reset(Zend_Db_Select::WHERE); it will clear the where clause completely, is it possible to clear only the AND (qtdavaliacoes='0') condition from it using zend?

As per the documentation , it is not possible to reset only part of the WHERE condition. You would need to either:

  • reset the whole WHERE condition and add the ones needed ;
  • re-instantiate your object and re-build your query all over again.

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