'y' ); protected function _from(Zend_Db_Select $select = null) { if (null === $select) { $select = $this->select; } $select->from($this->pair, array('id', 'type', 'title', 'image', 'html', 'backgroundImage', 'linkType', 'url', 'idPage')); return $select; } protected function _filterWhere(Zend_Db_Select $select) { $select = parent::_filterWhere($select); foreach ($this->_filter as $field => $value) { if (empty($value)) { continue; } switch ($field) { case 'show': $select->where("`{$this->_tableAlias}`.`{$field}` = " . $this->db->quote($value)); break; default: break; } } return $select; } public function getList($options = array()) { $list = parent::getList($options); $this->_prepareList($list); return $list; } protected function _prepareList(&$list) { foreach ($list as &$row) { $this->_prepareRow($row); } } protected function _prepareRow(&$row) { switch ($row['linkType']) { case 'cms': $page = App_Cms_Obj::getInstance()->getPageById($row['idPage']); $row['url'] = BASE_URL . '/' . $page['fullAlias']; break; case 'link': break; case 'none': $row['url'] = ''; break; default: break; } } public function getData($field = false) { $data = parent::getData($field); if (false === $field) { $this->_prepareRow($data); } return $data; } }