public function countRows($where = array()) { $syncDone = $this->_synchronize(); $ret = parent::countRows($where); $this->_unlockSync(); if ($syncDone) { $this->_afterSync(); } return $ret; }
public function testCountRows() { $fnf = new Kwf_Model_FnF(); $fnf->setData(array(array('id' => 2, 'name' => 'foo'), array('id' => 18, 'name' => 'bar'), array('id' => 456, 'name' => 'bar2'))); $proxy = new Kwf_Model_Proxy(array('proxyModel' => $fnf)); $this->assertEquals(3, $proxy->countRows()); $select = new Kwf_Model_Select(); $select->whereId(2); $fnf = new Kwf_Model_FnF(); $fnf->setData(array(array('id' => 2, 'name' => 'foo'), array('id' => 18, 'name' => 'bar'), array('id' => 456, 'name' => 'bar2'))); $proxy = new Kwf_Model_Proxy(array('proxyModel' => $fnf)); $this->assertEquals(1, $proxy->countRows($select)); }