コード例 #1
0
 /**
  * Lazy-loads config with values set from controller. Allows us to test config API.
  * @return Wikia\Search\Config
  */
 public function getConfig()
 {
     if ($this->config === null) {
         $this->config = new Wikia\Search\Config();
         $this->config->setLimit($this->getLimit())->setStart($this->getStart())->setNamespaces([NS_FILE])->setRank($this->getRank());
         $this->config->setFilterQueryByCode(Wikia\Search\Config::FILTER_VIDEO);
         if ($this->getSearchType() == 'premium') {
             $this->config->setWikiId(Wikia\Search\QueryService\Select\Dismax\Video::VIDEO_WIKI_ID);
         }
     }
     return $this->config;
 }