protected function _getCategories() { $mapper = new Model_Mapper_Category(); $categories = $mapper->fetchAll(0); foreach ($categories as $category) { $array[$category->id] = $category->name; } return $array; }
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; }
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; }