/** * Creates the list of objects. Sets the parameter $p_hasNextElements to * true if this list is limited and elements still exist in the original * list (from which this was truncated) after the last element of this * list. * * @param int $p_start * @param int $p_limit * @param array $p_parameters * @param int &$p_count * @return array */ protected function CreateList($p_start = 0, $p_limit = 0, array $p_parameters, &$p_count) { if ($p_parameters['scope'] == 'index') { $articlesList = Article::SearchByKeyword($p_parameters['search_phrase'], $p_parameters['match_all'], $this->m_constraints, $this->m_order, $p_start, $p_limit, $p_count); } else { $keywords = preg_split('/[\s,.-]/', $p_parameters['search_phrase']); $articlesList = Article::SearchByField($keywords, $p_parameters['scope'], $p_parameters['match_all'], $this->m_constraints, $this->m_order, $p_start, $p_limit, $p_count); } $metaArticlesList = array(); foreach ($articlesList as $article) { $metaArticlesList[] = new MetaArticle($article->getLanguageId(), $article->getArticleNumber()); } return $metaArticlesList; }
/** * Returns the value of the given property; throws * InvalidPropertyHandlerException if the property didn't exist. * * @param string $p_property * @return mixed */ public function __get($p_property) { $p_property = MetaAction::TranslateProperty($p_property); if ($p_property == 'results_count') { if (!empty($this->m_totalCount)) { return $this->m_totalCount; } if ($this->m_properties['scope'] == 'index') { Article::SearchByKeyword($this->m_properties['search_keywords'], $this->m_properties['match_all'], $this->m_properties['constraints'], array(), 0, 0, $this->m_totalCount, true); } else { Article::SearchByField($this->m_properties['search_keywords'], $this->m_properties['scope'], $this->m_properties['match_all'], $this->m_properties['constraints'], array(), 0, 0, $this->m_totalCount, true); } return $this->m_totalCount; } return parent::__get($p_property); }