示例#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;
 }