Joabe da Luz
Joabe da Luz

Reputation: 1020

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?

Upvotes: 0

Views: 777

Answers (1)

D4V1D
D4V1D

Reputation: 5849

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.

Upvotes: 1

Related Questions