where('`' . $this->_tableAlias . '`.`enabled` = "y"'); return $select; } protected function _filter(Zend_Db_Select $select) { parent::_filter($select); $select->where('`' . $this->_tableAlias . '`.`enabled` = "y"'); return $this; } public function getObjectInfo() { $data = parent::getObjectInfo(); if (!empty($data['title'])) { $data['itemTitle'] = '"' . $data['title'] . '"'; if (false !== strpos($data['title'], $this->getConfig('itemName'))) { $data['itemTitle'] .= ' / '; } else { $data['itemTitle'] .= ' Newsletter / '; } $data['itemTitle'] .= date('F, Y', strtotime($data['date'])); } return $data; } /** * @param string $year * @return string */ public function getLogUrl($year) { $newsletterUrl = Qs_SiteMap::findFirst( null, ['type' => 'Newsletter_'], ['type' => App_Newsletter_Form_Config::TYPE_DEFAULT], 'url' ); $url = $newsletterUrl . '/' . $year . '?action=download&id='; return $url; } protected function _prepareSearchList(array &$list, array $providerOptions) { $this->_prepareList($list); if (!empty($list)) { $query = $this->_filter['query']; foreach ($list as &$row) { $row['searchUrl'] = Qs_ImageFs::get($row['file']); $row['title'] = Qs_Text_Mark::markSearchWords($row['title'], $query); $row['content'] = 'Published in ' . date('F Y', strtotime($row['date'])); $year = explode('-', $row['date']); $year = reset($year); $row['downloadLogUrl'] = $this->getLogUrl($year) . $row['id']; } } return $this; } }