+ 'widget' => 'single_text',
+ ),
+ )
+ )
+ ->add('domainName', 'filter_text', array(
+ 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) {
+ $value = $values['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('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);
+ },
+ ))
+ ->add('language', 'filter_choice', array(
+ 'choices' => $this->repository->findDistinctLanguageByUser($this->user->getId()),
+ ))
+ ;