X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=src%2FWallabag%2FCoreBundle%2FFilter%2FEntryFilterType.php;h=024486e6be0c5410808fef5ee4d82c48c12a4ed0;hb=1db9d411c5b1fe592788866dc206e2fd6dc87a71;hp=85d1a0610c1e576fc40947bbf336c44695c0a922;hpb=7083d183b9df11f350be0d7039f5f0e33536b94b;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Filter/EntryFilterType.php b/src/Wallabag/CoreBundle/Filter/EntryFilterType.php index 85d1a061..024486e6 100644 --- a/src/Wallabag/CoreBundle/Filter/EntryFilterType.php +++ b/src/Wallabag/CoreBundle/Filter/EntryFilterType.php @@ -33,16 +33,27 @@ class EntryFilterType extends AbstractType ->add('domainName', 'filter_text', array( 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) { $value = $values['value']; - if (strlen($value) <= 3 || empty($value)) { + if (strlen($value) <= 2 || empty($value)) { return; } $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) { + if (false === $values['value']) { + return; + } + + $expression = $filterQuery->getExpr()->isNotNull($field); + + return $filterQuery->createCondition($expression); + }, + )); } public function getName()