public function sort() { $data = $this->_units->toArray(); $data = $this->_calculateAllPrices($data); usort($data, array('RM_Unit_Sorter', 'cmp')); $config = array('table' => $this->_units->getTable(), 'data' => $data, 'rowClass' => 'RM_Unit_Row', 'stored' => true); $this->_sortedUnits = new Zend_Db_Table_Rowset($config); }
protected function _loadByPrimaryKeys(\Zend_Db_Table_Rowset $results) { $collection = array(); foreach ($results->toArray() as $row) { $collection[] = $this->load(array_shift($row)); } return $collection; }