I have a SELECT object containing WHERE.
I can return WHERE with getPart(Zend_Db_Select::WHERE), this returns something like this:
array
0 => string "(clienttype = 'agent')"
1 => string "AND (nextpayment < (NOW() - INTERVAL 1 DAY))"
This array seems pretty useless since I can't do this with it
$client->update(array("paymentstatus" => "lapsed"), $where);
Or even put it in another SELECT object. Is there a way to get a more useful representation of the WHERE statement from a SELECT object?
thank
EDIT
The best I've come up with so far is
$where = new Zend_Db_Expr(implode(" ", $select->getPart(Zend_Db_Select::WHERE)));
source
share