X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FFilter%2FEntryFilterType.php;h=11c69abdf9ea4f21ef6083fda665636ecf46b796;hb=616f9fea26af9d9c9dd6134388811c120f1e9656;hp=ff51785b8411ca733def9bdc0cdfe12b84fd902e;hpb=89659c9eae338cd29e5919b5ffde6924189a59ca;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Filter/EntryFilterType.php b/src/Wallabag/CoreBundle/Filter/EntryFilterType.php index ff51785b..11c69abd 100644 --- a/src/Wallabag/CoreBundle/Filter/EntryFilterType.php +++ b/src/Wallabag/CoreBundle/Filter/EntryFilterType.php @@ -27,8 +27,9 @@ class EntryFilterType extends AbstractType ), 'format' => 'dd/MM/yyyy', 'widget' => 'single_text', - ), - )) + ), + ) + ) ->add('domainName', 'filter_text', array( 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) { $value = $values['value']; @@ -38,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()