示例#1
0
 /**
  * Returns all available filters
  *
  * @return FilterInterface[]
  */
 protected function getFilters()
 {
     $filters = [];
     $filtersConfig = $this->config->offsetGet('filters');
     foreach ($filtersConfig as $name => $attr) {
         $filters[$name] = $this->getFilterObject($name, $attr);
     }
     return $filters;
 }
示例#2
0
 /**
  * Returns all available functions for the given query type
  *
  * @param string $groupType The type of functions' group
  * @param string $queryType The query type
  * @return array
  */
 protected function getMetadataForFunctions($groupType, $queryType)
 {
     $result = [];
     $groupsConfig = $this->config->offsetGet($groupType);
     foreach ($groupsConfig as $name => $attr) {
         if ($this->isItemAllowedForQueryType($attr, $queryType)) {
             unset($attr['query_type']);
             $functions = [];
             foreach ($attr['functions'] as $function) {
                 $nameText = empty($function['name_label']) ? null : $this->translator->trans($function['name_label']);
                 $hintText = empty($function['hint_label']) ? null : $this->translator->trans($function['hint_label']);
                 $functions[] = ['name' => $function['name'], 'label' => $nameText, 'title' => $hintText];
             }
             $attr['functions'] = $functions;
             $result[$name] = $attr;
         }
     }
     return $result;
 }