getFilterCollection() public method

Retrieve the filter collection.
public getFilterCollection ( ) : MetaModels\Filter\Setting\ICollection
return MetaModels\Filter\Setting\ICollection
Example #1
0
 /**
  * Get the filters.
  *
  * @return array
  *
  * @SuppressWarnings(PHPMD.Superglobals)
  * @SuppressWarnings(PHPMD.CamelCaseVariableName)
  */
 protected function getFilters()
 {
     $filterOptions = $this->getFrontendFilterOptions();
     $jumpToInformation = $this->objFilterConfig->getJumpTo();
     $filterParameters = $this->getParams();
     $filterSetting = $this->objFilterConfig->getFilterCollection();
     $arrWidgets = $filterSetting->getParameterFilterWidgets($filterParameters['all'], $jumpToInformation, $filterOptions);
     // Filter the widgets we do not want to show.
     $wantedNames = $this->getWantedNames();
     $this->checkRedirect($arrWidgets, $wantedNames, $filterParameters);
     $renderedWidgets = array();
     // Render the widgets through the filter templates.
     foreach ($wantedNames as $strWidget) {
         $renderedWidgets[$strWidget] = $this->renderWidget($arrWidgets[$strWidget], $filterOptions);
     }
     $event = new GenerateFrontendUrlEvent($jumpToInformation, $this->getJumpToUrl($filterParameters['other']), null, true);
     $this->getDispatcher()->dispatch(ContaoEvents::CONTROLLER_GENERATE_FRONTEND_URL, $event);
     // Return filter data.
     return array('action' => $event->getUrl(), 'formid' => $this->formId, 'filters' => $renderedWidgets, 'submit' => $filterOptions->isAutoSubmit() ? '' : $GLOBALS['TL_LANG']['metamodels_frontendfilter']['submit']);
 }