public function getFilters(Layer $layer) { if (!$this->helper->isActiveEngine()) { return parent::getFilters($layer); } if (!count($this->filters)) { $this->filters = []; // $response = $this->_getResponse($layer); $response = $this->searchHelper->getCustomResults(); $questions = $response->QwiserSearchResults->Questions; $aaa = ''; foreach ($questions->children() as $question) { $this->filters[] = $this->createQuestionFilter($question, $layer); $this->appliedFilters[] = $question->getAttribute('Text'); } } $remFilters = array_diff($this->searchHelper->getFilterRequestVars(), $this->appliedFilters); foreach ($this->request->getParams() as $var => $value) { if (in_array($var, $remFilters)) { $question = $this->searchHelper->getQuestionByField($var, 'Text'); if ($question) { $this->createQuestionFilter($question, $layer)->apply($this->request); $this->appliedFilters[] = $var; } } } return $this->filters; }
protected function _getResponse() { if (is_null($this->response)) { $params = $this->searchHelper->getSearchParams(); $this->response = $this->searchHelper->getCustomResults($params); } return $this->response; }