]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Filter/EntryFilterType.php
filter for entries with previewPicture
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Filter / EntryFilterType.php
index 771daef1799edb9c02637570a82b89877e93bbac..c0b8919682dba71f9f1f4d4a5c4fb0130606176b 100644 (file)
@@ -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,7 +39,16 @@ 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('previewPicture', 'filter_checkbox', array(
+                'apply_filter' => function (QueryInterface $filterQuery, $field, $values) {
+                    $expression = $filterQuery->getExpr()->isNotNull($field);
+
+                    return $filterQuery->createCondition($expression);
+                },
             ));
     }