コード例 #1
0
ファイル: Post.php プロジェクト: kminkov/Blog
 protected function _getCategories()
 {
     $mapper = new Model_Mapper_Category();
     $categories = $mapper->fetchAll(0);
     foreach ($categories as $category) {
         $array[$category->id] = $category->name;
     }
     return $array;
 }
コード例 #2
0
ファイル: Search.php プロジェクト: kminkov/Blog
 public function _getCategories()
 {
     $mapper = new Model_Mapper_Category();
     $categories = $mapper->fetchAll();
     $array[0] = 'All Categories';
     foreach ($categories as $category) {
         $array[$category->name] = $category->name;
     }
     return $array;
 }
コード例 #3
0
ファイル: Category.php プロジェクト: kminkov/Blog
 public function fetchAll($is_published = 1)
 {
     $cache_id = md5('all_categories' . '_' . $is_published);
     if (!($data = $this->_cache->load($cache_id))) {
         $data = parent::fetchAll($is_published);
         $this->_cache->save($data, $cache_id, array('post'));
     }
     return $data;
 }