diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php')
-rw-r--r-- | src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php b/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php index 556578d1..6a4c485f 100644 --- a/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php +++ b/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php | |||
@@ -150,6 +150,20 @@ class EntryFilterType extends AbstractType | |||
150 | }, | 150 | }, |
151 | 'label' => 'entry.filters.preview_picture_label', | 151 | 'label' => 'entry.filters.preview_picture_label', |
152 | ]) | 152 | ]) |
153 | ->add('isPublic', CheckboxFilterType::class, [ | ||
154 | 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) { | ||
155 | if (false === $values['value']) { | ||
156 | return; | ||
157 | } | ||
158 | |||
159 | // is_public isn't a real field | ||
160 | // we should use the "uid" field to determine if the entry has been made public | ||
161 | $expression = $filterQuery->getExpr()->isNotNull($values['alias'].'.uid'); | ||
162 | |||
163 | return $filterQuery->createCondition($expression); | ||
164 | }, | ||
165 | 'label' => 'entry.filters.is_public_label', | ||
166 | ]) | ||
153 | ->add('language', ChoiceFilterType::class, [ | 167 | ->add('language', ChoiceFilterType::class, [ |
154 | 'choices' => array_flip($this->repository->findDistinctLanguageByUser($this->user->getId())), | 168 | 'choices' => array_flip($this->repository->findDistinctLanguageByUser($this->user->getId())), |
155 | 'label' => 'entry.filters.language_label', | 169 | 'label' => 'entry.filters.language_label', |