Exemplo n.º 1
0
 /**
  * @param \Leapt\AdminBundle\Datalist\Filter\DatalistFilterExpressionBuilder $builder
  * @param \Leapt\AdminBundle\Datalist\Filter\DatalistFilterInterface $filter
  * @param mixed $value
  * @param array $options
  */
 public function buildExpression(DatalistFilterExpressionBuilder $builder, DatalistFilterInterface $filter, $value, array $options)
 {
     if (is_array($options['search_fields'])) {
         $expression = new CombinedExpression(CombinedExpression::OPERATOR_OR);
         foreach ($options['search_fields'] as $searchField) {
             $comparisonExpression = new ComparisonExpression($searchField, ComparisonExpression::OPERATOR_LIKE, $value);
             $expression->addExpression($comparisonExpression);
         }
     } else {
         $expression = new ComparisonExpression($options['search_fields'], ComparisonExpression::OPERATOR_LIKE, $value);
     }
     $builder->add($expression);
 }
Exemplo n.º 2
0
 /**
  * @param \Leapt\AdminBundle\Datalist\Filter\DatalistFilterExpressionBuilder $builder
  * @param \Leapt\AdminBundle\Datalist\Filter\DatalistFilterInterface $filter
  * @param mixed $value
  * @param array $options
  */
 public function buildExpression(DatalistFilterExpressionBuilder $builder, DatalistFilterInterface $filter, $value, array $options)
 {
     $operator = true === $options['multiple'] ? ComparisonExpression::OPERATOR_IN : ComparisonExpression::OPERATOR_EQ;
     $builder->add(new ComparisonExpression($filter->getPropertyPath(), $operator, $value));
 }
Exemplo n.º 3
0
 /**
  * @param \Leapt\AdminBundle\Datalist\Filter\DatalistFilterExpressionBuilder $builder
  * @param \Leapt\AdminBundle\Datalist\Filter\DatalistFilterInterface $filter
  * @param mixed $value
  * @param array $options
  */
 public function buildExpression(DatalistFilterExpressionBuilder $builder, DatalistFilterInterface $filter, $value, array $options)
 {
     $builder->add(new ComparisonExpression($filter->getPropertyPath(), ComparisonExpression::OPERATOR_EQ, $value));
 }