/**
  * filter
  *
  * Construct the query by applying the specifications
  *
  * @param  \ArpSpecification\Entity\Spec\Adapter\QueryBuilderAdapterInterface $adapter
  * @return mixed
  */
 public function filter(QueryBuilderAdapterInterface $adapter)
 {
     $qb = $adapter->getQueryBuilder();
     $right = $this->right;
     //  Bind the value as a query parameter
     if ($this->bind) {
         $right = '?' . $adapter->getParameterIndex($right);
     }
     return new ComparisonExpr($this->left, $this->operator, $right);
 }
 /**
  * filter
  *
  * Filter the query by applying the specifications
  *
  * @param  \ArpSpecification\Entity\Spec\Adapter\QueryBuilderAdapterInterface $adapter
  * @return mixed
  */
 public function filter(QueryBuilderAdapterInterface $adapter)
 {
     $queryBuilder = $adapter->getQueryBuilder();
     $orX = $queryBuilder->expr()->orX();
     foreach ($this->specs as $spec) {
         if ($spec instanceof SpecificationInterface) {
             $orX->add($spec->filter($adapter));
         }
     }
     return $orX;
 }
 /**
  * filter
  *
  * Filter the query builder
  *
  * @param \ArpSpecification\Entity\Spec\Adapter\QueryBuilderAdapterInterface $adapter
  */
 public function filter(QueryBuilderAdapterInterface $adapter)
 {
     $qb = $adapter->getQueryBuilder();
     return $qb->expr()->notIn($this->name, $this->getParams());
 }
 /**
  * filter
  *
  * Filter the query builder
  *
  * @param \ArpSpecification\Entity\Spec\Adapter\QueryBuilderAdapterInterface $adapter
  */
 public function filter(QueryBuilderAdapterInterface $adapter)
 {
     $qb = $adapter->getQueryBuilder();
     //$placeholder = '?' . $adapter->getParameterIndex($this->getParams());
     return $qb->expr()->in($this->name, $this->getParams());
 }
 /**
  * filter
  *
  * Construct the query by applying the specifications
  *
  * @param  \ArpSpecification\Entity\Spec\Adapter\QueryBuilderAdapterInterface $adapter
  * @return mixed
  */
 public function filter(QueryBuilderAdapterInterface $adapter)
 {
     $queryBuilder = $adapter->getQueryBuilder();
     $expr = $queryBuilder->expr();
     return $expr->isNull($this->operand);
 }