I’m confused as to why Zend_DB doesn’t accept an array of WHERE clauses – or am I incorrect? I have made the following work around:
$all = new ORM_Model_DbTable_Asset();
$wheres = array('id > 0', 'enabled' => 1);
$all = $all->fetchAll(implode(' AND ', $wheres))->toArray();
for what I hoped would be:
$all = new ORM_Model_DbTable_Asset();
$wheres = array('id > 0', 'enabled' => 1);
$all = $all->fetchAll($wheres)->toArray();
Slightly disappointing, am I missing something?
From
Zend_Db_Table_AbstractSo you are incorrect,
fetchAll()does accept an array of where clauses.Your array should look like this (based on the definition in
Zend_Db_Select)