/** * Adds the search conditions to query * * @param ConditionsCollection $conditions * * @return ConditionsCollection */ public function addSearchConditions(ConditionsCollection $conditions) { $requestHelper = $this->getRequestHelper(); $phrase = $requestHelper->getAttributesBagParam('phrase'); $query = new SimpleQuery($phrase); $identifiers = $this->provider->searchProducts($query)->getResultIdentifiers(); $conditions->add(new In('id', $identifiers)); return $conditions; }
/** * {@inheritdoc} */ public function getQueryBuilder(ColumnCollection $columns, DataSetRequestInterface $request) { $qb = parent::getQueryBuilder($columns, $request); $qb->setParameter('scores', $this->provider->getResultIdentifiers()); return $qb; }