]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Filter/EntryFilterType.php
forgot case for previewPicture filter
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Filter / EntryFilterType.php
index ff51785b8411ca733def9bdc0cdfe12b84fd902e..11c69abdf9ea4f21ef6083fda665636ecf46b796 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,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()