getConfig() public method

Get the config of all fields for a given content type.
public getConfig ( string $contentType ) : array | false
$contentType string
return array | false
コード例 #1
0
ファイル: SearchConfigTest.php プロジェクト: robbert-vdh/bolt
 public function testViewless()
 {
     $app = $this->getApp();
     $app['config']->set('contenttypes/pages/viewless', true);
     $search = new SearchConfig($app['config']);
     $this->assertFalse($search->getConfig('pages'));
 }
コード例 #2
0
ファイル: SearchQuery.php プロジェクト: bolt/bolt
 /**
  * This overrides the SelectQuery default to do some extra preparation for a search query.
  * Firstly it builds separate filters for the search query and then it removes the filter
  * from the params and the others will then get processed normally by the parent.
  */
 protected function processFilters()
 {
     if (!$this->contentType) {
         throw new QueryParseException('You have attempted to run a search query without specifying a ContentType', 1);
     }
     if (!($config = $this->config->getConfig($this->contentType))) {
         throw new QueryParseException('You have attempted to run a search query on an unknown ContentType or one that is not searchable', 1);
     }
     $params = $this->params;
     unset($params['filter']);
     foreach ($config as $field => $options) {
         $params[$field] = $this->getSearchParameter();
     }
     $this->params = $params;
     parent::processFilters();
 }