diff options
author | Jeremy Benoist <j0k3r@users.noreply.github.com> | 2015-09-13 10:14:42 +0200 |
---|---|---|
committer | Jeremy Benoist <j0k3r@users.noreply.github.com> | 2015-09-13 10:14:42 +0200 |
commit | 40f59b219bfd438bdaf4f36227a43f2b674ece00 (patch) | |
tree | 5b882749cea7003f049940fccdfd4cb990c538a9 /src/Wallabag/CoreBundle/Filter/EntryFilterType.php | |
parent | fb96ea884532e9804194afd92a98c5c6aecc177e (diff) | |
parent | 497e0cad7ca2d2e771c8d41f7bc50ab2bc222cdb (diff) | |
download | wallabag-40f59b219bfd438bdaf4f36227a43f2b674ece00.tar.gz wallabag-40f59b219bfd438bdaf4f36227a43f2b674ece00.tar.zst wallabag-40f59b219bfd438bdaf4f36227a43f2b674ece00.zip |
Merge pull request #1418 from wallabag/v2-previewpicture-filter
filter for entries with previewPicture
Diffstat (limited to 'src/Wallabag/CoreBundle/Filter/EntryFilterType.php')
-rw-r--r-- | src/Wallabag/CoreBundle/Filter/EntryFilterType.php | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/Wallabag/CoreBundle/Filter/EntryFilterType.php b/src/Wallabag/CoreBundle/Filter/EntryFilterType.php index 85d1a061..de95eed9 100644 --- a/src/Wallabag/CoreBundle/Filter/EntryFilterType.php +++ b/src/Wallabag/CoreBundle/Filter/EntryFilterType.php | |||
@@ -39,10 +39,21 @@ class EntryFilterType extends AbstractType | |||
39 | $expression = $filterQuery->getExpr()->like($field, $filterQuery->getExpr()->literal('%'.$value.'%')); | 39 | $expression = $filterQuery->getExpr()->like($field, $filterQuery->getExpr()->literal('%'.$value.'%')); |
40 | 40 | ||
41 | return $filterQuery->createCondition($expression); | 41 | return $filterQuery->createCondition($expression); |
42 | }, | 42 | }, |
43 | )) | 43 | )) |
44 | ->add('isArchived', 'filter_checkbox') | 44 | ->add('isArchived', 'filter_checkbox') |
45 | ->add('isStarred', 'filter_checkbox'); | 45 | ->add('isStarred', 'filter_checkbox') |
46 | ->add('previewPicture', 'filter_checkbox', array( | ||
47 | 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) { | ||
48 | if (false === $values['value']) { | ||
49 | return; | ||
50 | } | ||
51 | |||
52 | $expression = $filterQuery->getExpr()->isNotNull($field); | ||
53 | |||
54 | return $filterQuery->createCondition($expression); | ||
55 | }, | ||
56 | )); | ||
46 | } | 57 | } |
47 | 58 | ||
48 | public function getName() | 59 | public function getName() |