/** * Account for group and having clauses, if any * * @return array */ public function getAllIds() { if (!$this->_interferWithCountSql) { return parent::getAllIds(); } $idsSelect = clone $this->getSelect(); $idsSelect->reset(Zend_Db_Select::ORDER); $idsSelect->reset(Zend_Db_Select::LIMIT_COUNT); $idsSelect->reset(Zend_Db_Select::LIMIT_OFFSET); //$idsSelect->reset(Zend_Db_Select::COLUMNS); $idsSelect->columns($this->getResource()->getIdFieldName(), 'main_table'); return $this->getConnection()->fetchCol($idsSelect); }
public function testGetAllIdsWithBind() { $this->_model->getSelect()->where('code = :code'); $this->_model->addBindParam('code', 'admin'); $this->assertEquals(array('0'), $this->_model->getAllIds()); }
/** * Retrive all ids for collection * * @return array */ public function getAllIds() { if (is_null($this->_itemIds)) { $this->_itemIds = parent::getAllIds(); } return $this->_itemIds; }