aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php
diff options
context:
space:
mode:
authorDaniel Bartram <me@danielbartram.com>2016-05-09 14:19:09 +0100
committerThomas Citharel <tcit@tcit.fr>2016-06-23 09:15:50 +0200
commit710f8e69d76c1a0d6279397c0283612ccef8ae69 (patch)
treef635b5efc001bf25a221b63b0d5b8d8d0bb04986 /src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php
parent235026e2c708eea306a12f1cc1de3da38593db37 (diff)
downloadwallabag-710f8e69d76c1a0d6279397c0283612ccef8ae69.tar.gz
wallabag-710f8e69d76c1a0d6279397c0283612ccef8ae69.tar.zst
wallabag-710f8e69d76c1a0d6279397c0283612ccef8ae69.zip
Add unread filter to entries pages
Add the ability to filter for unread pages in the filters menu.
Diffstat (limited to 'src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php')
-rw-r--r--src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php b/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php
index cd4d3490..f3f848e9 100644
--- a/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php
+++ b/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php
@@ -87,6 +87,18 @@ class EntryFilterType extends AbstractType
87 ->add('isStarred', CheckboxFilterType::class, [ 87 ->add('isStarred', CheckboxFilterType::class, [
88 'label' => 'entry.filters.starred_label', 88 'label' => 'entry.filters.starred_label',
89 ]) 89 ])
90 ->add('isUnread', CheckboxFilterType::class, [
91 'label' => 'entry.filters.unread_label',
92 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) {
93 if (false === $values['value']) {
94 return;
95 }
96
97 $expression = $filterQuery->getExpr()->eq('e.isArchived', 'false');
98
99 return $filterQuery->createCondition($expression);
100 },
101 ])
90 ->add('previewPicture', CheckboxFilterType::class, [ 102 ->add('previewPicture', CheckboxFilterType::class, [
91 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) { 103 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) {
92 if (false === $values['value']) { 104 if (false === $values['value']) {