aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php')
-rw-r--r--src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php b/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php
index 6a4c485f..6f8c9e27 100644
--- a/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php
+++ b/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php
@@ -4,12 +4,12 @@ namespace Wallabag\CoreBundle\Form\Type;
4 4
5use Doctrine\ORM\EntityRepository; 5use Doctrine\ORM\EntityRepository;
6use Lexik\Bundle\FormFilterBundle\Filter\FilterOperands; 6use Lexik\Bundle\FormFilterBundle\Filter\FilterOperands;
7use Lexik\Bundle\FormFilterBundle\Filter\Query\QueryInterface;
8use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\NumberRangeFilterType;
9use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\DateRangeFilterType;
10use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\TextFilterType;
11use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\CheckboxFilterType; 7use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\CheckboxFilterType;
12use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\ChoiceFilterType; 8use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\ChoiceFilterType;
9use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\DateRangeFilterType;
10use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\NumberRangeFilterType;
11use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\TextFilterType;
12use Lexik\Bundle\FormFilterBundle\Filter\Query\QueryInterface;
13use Symfony\Component\Form\AbstractType; 13use Symfony\Component\Form\AbstractType;
14use Symfony\Component\Form\FormBuilderInterface; 14use Symfony\Component\Form\FormBuilderInterface;
15use Symfony\Component\HttpFoundation\Response; 15use Symfony\Component\HttpFoundation\Response;
@@ -99,7 +99,7 @@ class EntryFilterType extends AbstractType
99 if (strlen($value) <= 2 || empty($value)) { 99 if (strlen($value) <= 2 || empty($value)) {
100 return; 100 return;
101 } 101 }
102 $expression = $filterQuery->getExpr()->like($field, $filterQuery->getExpr()->lower($filterQuery->getExpr()->literal('%'.$value.'%'))); 102 $expression = $filterQuery->getExpr()->like($field, $filterQuery->getExpr()->lower($filterQuery->getExpr()->literal('%' . $value . '%')));
103 103
104 return $filterQuery->createCondition($expression); 104 return $filterQuery->createCondition($expression);
105 }, 105 },
@@ -113,8 +113,8 @@ class EntryFilterType extends AbstractType
113 } 113 }
114 114
115 $paramName = sprintf('%s', str_replace('.', '_', $field)); 115 $paramName = sprintf('%s', str_replace('.', '_', $field));
116 $expression = $filterQuery->getExpr()->eq($field, ':'.$paramName); 116 $expression = $filterQuery->getExpr()->eq($field, ':' . $paramName);
117 $parameters = array($paramName => $value); 117 $parameters = [$paramName => $value];
118 118
119 return $filterQuery->createCondition($expression, $parameters); 119 return $filterQuery->createCondition($expression, $parameters);
120 }, 120 },
@@ -158,7 +158,7 @@ class EntryFilterType extends AbstractType
158 158
159 // is_public isn't a real field 159 // is_public isn't a real field
160 // we should use the "uid" field to determine if the entry has been made public 160 // we should use the "uid" field to determine if the entry has been made public
161 $expression = $filterQuery->getExpr()->isNotNull($values['alias'].'.uid'); 161 $expression = $filterQuery->getExpr()->isNotNull($values['alias'] . '.uid');
162 162
163 return $filterQuery->createCondition($expression); 163 return $filterQuery->createCondition($expression);
164 }, 164 },