X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FFilter%2FEntryFilterType.php;h=11c69abdf9ea4f21ef6083fda665636ecf46b796;hb=616f9fea26af9d9c9dd6134388811c120f1e9656;hp=85d1a0610c1e576fc40947bbf336c44695c0a922;hpb=7d6c3edcdd2730a46d59c186048e76fa72e364c7;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Filter/EntryFilterType.php b/src/Wallabag/CoreBundle/Filter/EntryFilterType.php index 85d1a061..11c69abd 100644 --- a/src/Wallabag/CoreBundle/Filter/EntryFilterType.php +++ b/src/Wallabag/CoreBundle/Filter/EntryFilterType.php @@ -39,10 +39,23 @@ class EntryFilterType extends AbstractType $expression = $filterQuery->getExpr()->like($field, $filterQuery->getExpr()->literal('%'.$value.'%')); return $filterQuery->createCondition($expression); - }, + }, )) ->add('isArchived', 'filter_checkbox') - ->add('isStarred', 'filter_checkbox'); + ->add('isStarred', 'filter_checkbox') + ->add('previewPicture', 'filter_checkbox', array( + 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) { + $value = $values['value']; + + if (false === $value) { + return; + } + + $expression = $filterQuery->getExpr()->isNotNull($field); + + return $filterQuery->createCondition($expression); + }, + )); } public function getName()