public function getSynonyms($id) { $synonymsMapper = new Application_Model_SynonymsMapper(); $dbTable = $synonymsMapper->getDbTable(); $rowSet = $dbTable->fetchAll($dbTable->select()->where('objects_id = ?', $id)); if ($rowSet) { $entries = null; foreach ($rowSet as $row) { $synonym = new Application_Model_Synonyms(); $synonym->setId($row->id); $synonym->setName($row->name); $entries[] = $synonym; } return $entries; } else { throw new Zend_Exception('Could not get actions list!'); } }
public function fetchAll() { $dbTable = $this->getDbTable(); $entries = array(); $rowSet = $dbTable->fetchAll(); if ($rowSet) { foreach ($rowSet as $row) { $synonym = new Application_Model_Synonyms(); $synonym->setId($row->id); $synonym->setName($row->name); $synonym->setObjectsId($row->objects_id); $entries[] = $synonym; } return $entries; } else { throw new Zend_Exception('Could not get actions list!'); } }