Zend_DB가 WHERE
절의 배열을 허용하지 않는 이유에 대해 혼란 스럽습니다. 그렇지 않습니까?Zend DB fetchAll() : 배열로
$all = new ORM_Model_DbTable_Asset();
$wheres = array('id > 0', 'enabled' => 1);
$all = $all->fetchAll(implode(' AND ', $wheres))->toArray();
나는 것 기대 것에 대해 :
$all = new ORM_Model_DbTable_Asset();
$wheres = array('id > 0', 'enabled' => 1);
$all = $all->fetchAll($wheres)->toArray();
이 약간 실망, 내가 뭔가를 놓친 거지 내가 주변에 다음과 같은 작업을 만들었습니다?
/**
* Fetches all rows.
*
* Honors the Zend_Db_Adapter fetch mode.
*
* @param string|array|Zend_Db_Table_Select $where OPTIONAL An SQL WHERE clause or Zend_Db_Table_Select object.
* @param string|array $order OPTIONAL An SQL ORDER clause.
* @param int $count OPTIONAL An SQL LIMIT count.
* @param int $offset OPTIONAL An SQL LIMIT offset.
* @return Zend_Db_Table_Rowset_Abstract The row results per the Zend_Db_Adapter fetch mode.
*/
public function fetchAll($where = null, $order = null, $count = null, $offset = null)
() 객체를 ? $ where = $ this-> select(); $ where-> where (array ('id> 0', 'enabled =?', 1)); 또는 비슷한 무엇입니까? – Phil