Filter reference
Inherit options
hidden
type: boolean
Controls if the filter is visible. Default is true
columns:
myFilter:
hidden: false
initial_active
type: boolean
Controls if the filter is initially visible and doesn't need to be activated via the filters dropdown first. Default is false
columns:
myFilter:
initial_active: true
initial_value
type: string|null
If set, this filter will be initially have a set value and the list will initially be filtered by this value. Default null
.
columns:
myFilter:
initial_value: Foo
label
type: string
The label of the filter. It will be translated over the translation service automatically. (See translation_domain)
columns:
myFilter:
label: myLabel
permission
type: string|null
Symfony security role required for the user to be able to see and use the filter. Default is null
.
columns:
myFilter:
permission: ROLE_ENHAVO_ARTICLE_ARTICLE_EDIT
property
type: string
Define which property of the resource is used for this filter. The resource has to provide a getter method for that property.
filters:
myFilter:
property: name
translation_domain
type: string
Overwrite the default translationDomain. EnhavoAppBundle
is used by default.
columns:
myFilter:
translation_domain: myTranslationDomain
Age
The AgeFilter can be used to filter an age in full years. The parameter property needs to refer to a date representing the date of birth/origin, and the age is calculated from that date until today.
Type | text |
Class | Enhavo\Bundle\AppBundle\Filter\Type\AgeFilter |
Options | property*, label_from, label_to |
Inherit Options | label, locale, format, initial_active, initial_value, condition, width, permission, component |
label_from
type: string|null
The label for the field where the user can set the lower value of the range. It will be translated over the translation service automatically. (See translation_domain) If not set, the value of label will be used. If that one is also null, no label will be displayed.
columns:
myFilter:
label_from: myRange from
label_to
type: string|null
The label for the field where the user can set the lower value of the range. If not set, the value of label will be used. If that one is also null, no label will be displayed. It will be translated over the translation service automatically. (See translation_domain)
columns:
myFilter:
label_to: to
label
type: string|null
The label of the filter in the filter dropdown. If not set, the value of label_from will be used. It will be translated over the translation service automatically. (See translation_domain)
columns:
myFilter:
label: myLabel
Auto Complete
The EntityFilter filters a property for entities as a dropdown.
It is not recommended to use this filter if the number of possible entities is possible to become very big. If this is the case, consider using AutoCompleteEntityFilter instead.
Type | auto_complete_entity |
Class | Enhavo\Bundle\AppBundle\Filter\Type\AutoCompleteEntityFilter |
Options | route*, property*, label*, route_parametersminimum_input_length |
Inherit Options | label, locale, format, initial_active, initial_value, initial_value_arguments, initial_value_repository, initial_value_choice_label, condition, width, permission, component |
route
type: string
Route that will be called for the autocomplete search. The route will be used in the following way:
- Get-Parameter [q]{.title-ref} will have the search term as a string
- Get-Parameter [page]{.title-ref} will be an integer representing the pagination page
- Additional parameters may be defined via the parameter route_parameters
- The result must be a json array with the results in the format:
[{ code: id; label: "Label" }]
filter:
myFilter:
route: my_entity_autocomplete_route
route_parameters
type: array
Optional additional parameters for the route defined in route. Default is an empty array.
filter:
myFilter:
route: my_entity_autocomplete_route
route_parameters: { foo: "bar" }
minimum_input_length
type: int
The minimum number of characters before an autocomplete search is started. Default is [3]{.title-ref}.
filter:
myFilter:
minimum_input_length: 5
initial_value
type: string|null
If set, this filter will be initially have a set value and the list will initially be filtered by this value. This must be a method of the repository defined by the parameter initial_value_repository which returns either a single object or an array with at least one entry (the first entry will be used). Default [null]{.title-ref}.
columns:
myFilter:
initial_value: findByFoo
initial_value_repository: AppBundle\Repository\MyEntityRepository
initial_value_arguments
type: [array|null]
Optional arguments that will be added to the call of the repository method in parameter initial_value. Default is [null]{.title-ref}.
columns:
myFilter:
initial_value: findByFoo
initial_value_arguments: { foo: 'bar' }
initial_value_repository
type: string|null
This parameter is needed and no longer optional if initial_value is not null.
Either the name of a public service that points to the entity's repository or the FQCN of the entity to be used on EntityManager::getRepository(). This will be used to find the initial value.
Default is [null]{.title-ref}.
columns:
myFilter:
initial_value: findByFoo
initial_value_repository: AppBundle\Repository\MyEntityRepository
initial_value_choice_label
type: string|null
Property of the entity that will be used as label of the initial value if initial_value is set. Default is [null]{.title-ref}.
filter:
myFilter:
initial_value: findByFoo
initial_value_repository: AppBundle\Repository\MyEntityRepository
initial_value_choice_label: title
Between
The BetweenFilter can be used to filter in a range between two values. It works on any type that can be compared using ">=" and "<=" in the database query.
Type | between |
Class | Enhavo\Bundle\AppBundle\Filter\Type\BetweenFilter |
Options | property*, label_from, label_to |
Inherit Options | label, locale, format, condition, width, permission, component |
label_from
type: string|null
The label for the field where the user can set the lower value of the range. It will be translated over the translation service automatically. (See translation_domain) If not set, the value of label will be used. If that one is also null, no label will be displayed.
columns:
myFilter:
label_from: myRange from
label_to
type: string|null
The label for the field where the user can set the lower value of the range. If not set, the value of label will be used. If that one is also null, no label will be displayed. It will be translated over the translation service automatically. (See translation_domain)
columns:
myFilter:
label_to: to
label
type: string|null
The label of the filter in the filter dropdown. If not set, the value of label_from will be used. It will be translated over the translation service automatically. (See translation_domain)
columns:
myFilter:
label: myLabel
Boolean
The BooleanFilter filters a boolean property. It has two distinct variants depending on the parameter checkbox.
If checkbox is true, the filter will be rendered as a checkbox. If the checkbox is unchecked, the filter will be inactive and allow any value on the target's property field. If the checkbox is checked, only values equal to this filter's parameter equals are allowed. In the checkbox variant, there is no way to filter for the opposite of what the parameter equals is set to.
If checkbox is false, the filter will be rendered as a dropdown with both the option of filtering for true, for false and for an inactive filter.
Type | boolean |
Class | Enhavo\Bundle\AppBundle\Filter\Type\BooleanFilterType |
Options | property*, label*, checkbox, equals, label_true, label_false |
Inherit Options | label, locale, format, initial_active, initial_value, condition, width, permission, component |
checkbox
type: boolean
Controls whether the filter is displayed as a checkbox or a dropdown. Default is [true]{.title-ref}.
filter:
myFilter:
type: boolean
checkbox: false
equals
type: boolean
Only used if checkbox is true. Controls whether an active filter allows for the property to be true or false. Default is [true]{.title-ref}.
filter:
myFilter:
type: boolean
equals: true
label_true
type: string
Only used if checkbox is false. Controls the label of the dropdown entry for the value true. Default [filter.boolean.label_true]{.title-ref}. Will be translated over the translation service automatically. (See translation_domain)
filter:
myFilter:
type: boolean
label_true: Yes
label_false
type: string
Only used if checkbox is false. Controls the label of the dropdown entry for the value false. Default [filter.boolean.label_false]{.title-ref}. Will be translated over the translation service automatically. (See translation_domain)
filter:
myFilter:
type: boolean
label_false: No
Date Between
The DateBetweenFilter can be used to filter for dates in a range.
Type | date_between |
Class | Enhavo\Bundle\AppBundle\Filter\Type\DateBetweenFilter |
Options | property*, label_from, label_to |
Inherit Options | label, locale, format, initial_active, initial_value, condition, width, permission, component |
label_from
type: string|null
The label for the field where the user can set the lower value of the range. It will be translated over the translation service automatically. (See translation_domain) If not set, the value of label will be used. If that one is also null, no label will be displayed.
columns:
myFilter:
label_from: myRange from
label_to
type: string|null
The label for the field where the user can set the lower value of the range. If not set, the value of label will be used. If that one is also null, no label will be displayed. It will be translated over the translation service automatically. (See translation_domain)
columns:
myFilter:
label_to: to
label
type: string|null
The label of the filter in the filter dropdown. If not set, the value of label_from will be used. It will be translated over the translation service automatically. (See translation_domain)
columns:
myFilter:
label: myLabel
locale
type: string
The locale used for the Datepicker form fields. Defaults is the default locale of the project.
columns:
myFilter:
locale: en
format
type: string
The date format used for the Datepicker form fields. Uses the date format of vue3-datepicker. Default is [dd.MM.yyyy]{.title-ref}.
columns:
myFilter:
format: yyyy-MM-dd
Entity
The EntityFilter filters a property for entities as a dropdown.
If the number of possible entities is large, this filter will negatively effect performance. If this is the case, consider using AutoCompleteEntityFilter instead.
Type | entity |
Class | Enhavo\Bundle\AppBundle\Filter\Type\EntityFilter |
Options | repository*, property*, label*, method, arguments, choice_label |
Inherit Options | label, locale, format, initial_active, initial_value, condition, width, permission, component |
repository
type: string
Either the name of a public service that points to the entity's repository or the FQCN of the entity to be used on EntityManager::getRepository().
filter:
myFilter:
repository: AppBundle\Repository\MyEntityRepository
method
type: string
The name of the method of the repository which should be called. Default is [findAll]{.title-ref}.
filter:
myFilter:
method: findAll
arguments
type: [array|null]
Optional arguments that will be added to the call of the repository method. Default is [null]{.title-ref}.
filter:
myFilter:
method: findBy
arguments: { public: true }
choice_label
type: string|null
Property of the entity that will be used as label in the options list.
filter:
myFilter:
choice_label: title
initial_value
type: string|null
If set, this filter will be initially have a set value and the list will initially be filtered by this value. This must be a method of the repository defined by the parameter repository which returns either a single object or an array with at least one entry (the first entry will be used). Default [null]{.title-ref}.
columns:
myFilter:
initial_value: findByFoo
initial_value_arguments
type: array
Optional arguments that will be added to the call of the repository method in parameter initial_value. Default is [null]{.title-ref}.
columns:
myFilter:
initial_value: findByFoo
initial_value_arguments: { foo: 'bar' }
Option
The OptionFilter filters a property for specific options.
Type | option |
Class | Enhavo\Bundle\AppBundle\Filter\Type\OptionFilter |
Options | options*, property*, label*, |
Inherit Options | label, locale, format, initial_active, initial_value, condition, width, permission, component |
options
type: array<string>
Define the options, which the user can choose
filter:
myFilter:
options:
Foo: Bar
Hello: World
initial_value
type: string|null
If set, this filter will be initially have a set value and the list will initially be filtered by this value. This must be NULL or one of the array keys in the parameter options. Default is null
.
columns:
myFilter:
initial_value: Foo
Taxonomy
The TaxonomyFilter filters by a taxonomy.
Type | taxonomy |
Class | Enhavo\Bundle\TaxonomyBundle\Filter\TaxonomyFilterType |
Options | taxonomy*, property*, label* |
Inherit Options | label, locale, format, initial_active, initial_value, condition, width, permission, component |
taxonomy
type: string
The slug of the Taxonomy.
columns:
myFilter:
type: taxonomy
operator: article_category
initial_value_method
type: string|null
Defines the repository method to use when setting the initial value. Default [findOneByNameAndTaxonomy]{.title-ref}. If multiple results are returned by the method, the first one is used.
columns:
myFilter:
initial_value: Foo
initial_value_method: findOneByBar
initial_value_arguments
type: string|null
Optional arguments that will be added to the call of the repository method. Default is an array containing the values of parameters initial_value and taxonomy.
columns:
myFilter:
initial_value: Foo
initial_value_method: findOneByFoo
initial_value_arguments: { foo: 'bar' }
Text
The TextFilter filters a property by user string
Type | text |
Class | Enhavo\Bundle\AppBundle\Filter\Type\TextFilter |
Options | property*, label*, operator |
Inherit Options | label, locale, format, initial_active, initial_value, condition, width, permission, component |
operator
type: string
The operator used when applying this filter to the database search. Can be one of the following:
=
!=
like
(default)start_like
end_like
Default is [like]{.title-ref}.
columns:
myFilter:
type: text
operator: start_like