array('title', 'description')); protected function _where(Zend_Db_Select $select = null) { $select = parent::_where($select); $select->where("`{$this->_tableAlias}`.`enabled` = 'y'"); return $select; } protected function _prepareList(&$list) { if ($list) { $tmpList = array(); foreach ($list as $file) { $tmpList[$file['idCategory']][$file['id']] = $file; } $list = $tmpList; } return parent::_prepareList($list); } public static function getCategoryTitle($id) { $db = Qs_Db::getInstance(); $select = $db->select(); $select->from(array('DirectorFileCategory' => Qs_Db::getTableName('DirectorFileCategory')), array('title')); $select->where('id = ?', (int) $id, Qs_Db::INT_TYPE); return $db->fetchOne($select); } public static function getFile($id) { $db = Qs_Db::getInstance(); $select = $db->select(); $select->from(Qs_Db::getTableName('DirectorFile'), array('file')); $select->where('id = ?', (int) $id, Qs_Db::INT_TYPE); $doc = Zend_Registry::get('doc'); if ($doc instanceof App_Doc_User) { $select->where('enabled = "y"'); } return $db->fetchOne($select); } protected function _order(Zend_Db_Select $select = null) { return parent::_order($select)->order("categorySorter"); } }