function update_root_cache() { if (!isset($this->params['requested'])) { return $this->do404(); } $rootPages = $this->{$this->modelClass}->find('all', array('conditions' => 'parent_id IS NULL AND url <> \'/\'', 'recursive' => -1, 'fields' => array('id', 'url', 'slug'))); WildflowerRootPagesCache::write($rootPages); return $rootPages; }
function update_root_cache() { if (!isset($this->params['requested'])) { return $this->do404(); } // Get all pages without a parent except the home page and also all the home page children $homePageId = Configure::read('Wildflower.settings.home_page_id'); $rootPages = $this->{$this->modelClass}->find('all', array('conditions' => "parent_id IS NULL AND url <> '/' OR parent_id = {$homePageId}", 'recursive' => -1, 'fields' => array('id', 'url', 'slug'))); if (!Configure::read('Wildflower.disableRootPageCache')) { WildflowerRootPagesCache::write($rootPages); } return $rootPages; }