function &initArticleSet(&$dbcon) { $articleSet = new ArticleSet($dbcon); $articleSet->addCriteria("state=" . $this->_region->id); $criteria = new AMPContent_DisplayCriteria(); $criteria->clean($articleSet); return $articleSet; }
function initResults() { $source_set = new ArticleSet(AMP_Registry::getDbcon()); $this->_initSort($source_set); parent::init($source_set, false); $display_criteria = new AMPContent_DisplayCriteria(); $display_criteria->clean($this->_source); $this->_source->applySearch($this->_searchForm->getSearchValues()); }
function &getContents() { if (isset($this->_contents)) { return $this->_contents; } $finder = new Article($this->dbcon); $this->_contents = new ArticleSet($this->dbcon); $this->_contents->setSort(array('date DESC', 'id DESC')); if ($this->id == AMP_CONTENT_CLASS_FRONTPAGE) { $this->_contents->addCriteria(join($finder->makeCriteria(array('class' => $this->id, 'live' => 1)), " AND ")); $this->_contents->addSort('if (( isnull( pageorder ) or pageorder="" or pageorder=0 ), ' . AMP_SORT_MAX . ', pageorder)'); } else { $this->_contents->addCriteria(join($finder->makeCriteria(array('class' => $this->id, 'displayable' => true)), " AND ")); } foreach ($this->_contents_criteria as $criteria) { $this->_contents->addCriteria($criteria); } $criteria_set = new AMPContent_DisplayCriteria(); $criteria_set->allowClass($this->id); $criteria_set->clean($this->_contents); return $this->_contents; }