FacetedCategoryMultipleChoice
class FacetedCategoryMultipleChoice extends FacetedCategoryChoice
Facet filter, with multiple items to choose from
Traits
Constants
| DISPLAY_TYPE_CHECKBOX |
|
| DISPLAY_TYPE_TEXT |
|
| DISPLAY_TYPE_DATE |
|
| DISPLAY_TYPE_TOGGLE |
|
Properties
| protected FacetedFilter | $faceted | from FacetedCategory | |
| protected I18nTokenHelper | $label | from FacetedCategory | |
| protected array | $defaultValues | from FacetedCategory | |
| protected bool | $hasMoreItems | from FacetedCategory | |
| protected bool | $showEmptyItems | from FacetedCategory | |
| protected bool | $showInMoreOnly | from FacetedCategory | |
| protected bool | $showItemCount | from FacetedCategory | |
| protected Closure|string|null | $callback | from FacetedCategory | |
| protected string | $modelProperty | from FacetedCategoryChoice |
Methods
Adds a default value for this category.
No description
Sets items to active based on the given $values
Set the default value(s) for this category
The property name of the model to filter
The option list to use as label map for the values of the $property
Set the condition selected items should be connected.
If enabled, the category will also show items with a hit count of 0
If enabled, the category will only be shown in the "more filters" section
Details
in
FacetedCategory at line 368
protected
__construct()
Constructor
in
FacetedCategory at line 372
string
__toString()
No description
in
FacetedCategory at line 197
FacetedCategory
addDefaultValue(string $defaultValue)
Adds a default value for this category.
in
FacetedCategoryChoice at line 294
FacetedCategoryChoice
addItem(string $itemLabel, Condition $condition, string $value = '', bool $default = false, bool $active = false, int|null $count = null)
Adds a FacetedCategoryItem to the $item array
at line 63
Collection
addScopeCondition(Collection $collection, array $active)
No description
in
FacetedCategoryChoice at line 52
void
autoBuildItems(Collection $collection, int $limit, string $query = '')
No description
in
ItemListTrait at line 147
int
count()
No description
in
ItemListTrait at line 37
static ItemListTrait
create(ItemInterface ...$items)
No description
at line 24
static FacetedCategory
createCategory(FacetedFilter $faceted, I18nTokenHelper $label)
No description
in
ItemListTrait at line 96
ItemInterface|null
first()
Get first element
in
FacetedCategory at line 308
array
getActiveItems()
Returns items of this category, which are active
in
FacetedCategory at line 218
array
getDefaultValues()
getter
in
FacetedCategoryChoice at line 29
string
getDisplayType()
No description
in
FacetedCategory at line 115
bool
getHasMoreItems()
No description
in
FacetedCategory at line 122
string
getIconClass()
No description
in
ItemListTrait at line 57
array
getItems()
No description
in
ItemListTrait at line 107
ArrayIterator
getIterator()
No description
in
FacetedCategory at line 361
string
getKey()
No description
in
FacetedCategory at line 103
I18nTokenHelper
getLabel()
No description
in
FacetedCategoryChoice at line 275
protected OptionList|null
getLabelOptionList()
No description
at line 37
array
getOptions()
No description
in
FacetedCategory at line 187
bool
getShowInMoreOnly()
Getter for showInMoreOnly
in
FacetedCategory at line 418
bool
getShowItemCount()
No description
in
FacetedCategory at line 398
bool
hasCallback()
Does category have a callback?
in
FacetedCategory at line 111
bool
hasItems()
Are FacetedCategoryItems defined?
in
FacetedCategory at line 408
void
invokeCallBack(Collection $collection, array $selectedCategoryValues = [])
No description
in
FacetedCategory at line 142
bool
isRequired()
No description
in
ItemListTrait at line 154
array
jsonSerialize()
No description
in
ItemListTrait at line 88
ItemInterface|null
last()
Return the last element
in
ItemListTrait at line 116
bool
offsetExists($offset)
No description
in
ItemListTrait at line 125
ItemInterface|null
offsetGet($offset)
No description
in
ItemListTrait at line 133
void
offsetSet($offset, $value)
No description
in
ItemListTrait at line 140
void
offsetUnset($offset)
No description
in
ItemListTrait at line 44
int
push(ItemInterface $item)
No description
in
FacetedCategory at line 325
FacetedCategory
pushItem(FacetedCategoryItem $item)
Adds an item to the ItemList
in
FacetedCategory at line 240
FacetedCategory
setActive(array $values)
Sets items to active based on the given $values
in
FacetedCategory at line 389
FacetedCategory
setCallback(Closure $callback)
Sets the callback to filter the $collection
in
FacetedCategory at line 209
FacetedCategory
setDefaultValues(array $defaultValues)
Set the default value(s) for this category
in
FacetedCategory at line 262
void
setDefaults()
Use setDefaultValues() to set the default values.
Calls the setDefault() and setActive() methods for items that are default values. (if the category has no active item)
in
FacetedCategoryChoice at line 255
FacetedCategoryChoice
setFilterProperty(string $propertyName)
The property name of the model to filter
in
FacetedCategory at line 132
FacetedCategory
setIconClass(string $iconClass)
No description
in
ItemListTrait at line 66
void
setItems(array $items)
No description
in
FacetedCategory at line 350
FacetedCategory
setKey(string $key)
No description
in
FacetedCategoryChoice at line 267
FacetedCategoryChoice
setLabelList(OptionListCollectionInterface|null $labelList)
The option list to use as label map for the values of the $property
in
FacetedCategory at line 152
FacetedCategory
setRequired(bool $required)
No description
at line 56
void
setSelectionCondition(string $selectionCondition = Query::BOOLEAN_AND)
Set the condition selected items should be connected.
Query::BOOLEAN_AND - Results have to match all selected items Query::BOOLEAN_OR - Results have to match at least one selected item
in
FacetedCategory at line 166
FacetedCategory
setShowEmptyItems(bool $show = true)
If enabled, the category will also show items with a hit count of 0
in
FacetedCategory at line 178
FacetedCategory
setShowInMoreOnly(bool $show = true)
If enabled, the category will only be shown in the "more filters" section
in
FacetedCategory at line 422
FacetedCategory
setShowItemCount(bool $showItemCount = true)
No description
in
FacetedCategory at line 295
protected void
sortItems()
Sorts the category items by hit count (descending)
in
ItemListTrait at line 74
array
toArray()
Transforms the option into an array.
in
ItemListTrait at line 49
int
unshift(ItemInterface $item)
No description