class FilterCollection (View source)

Collection class for all the query filters.

Constants

FILTERS_STATE_CLEAN

A filter object is in CLEAN state when it has no changed parameters.

FILTERS_STATE_DIRTY

A filter object is in DIRTY state when it has changed parameters.

Methods

__construct(EntityManagerInterface $em)

No description

getEnabledFilters()

Gets all the enabled filters.

enable(string $name)

Enables a filter from the collection.

disable(string $name)

Disables a filter.

getFilter(string $name)

Gets an enabled filter from the collection.

bool
has(string $name)

Checks whether filter with given name is defined.

bool
isEnabled(string $name)

Checks if a filter is enabled.

bool
isClean()

No description

string
getHash()

Generates a string of currently enabled filters to use for the cache id.

setFiltersStateDirty()

Sets the filter state to dirty.

Details

__construct(EntityManagerInterface $em)

Parameters

EntityManagerInterface $em

SQLFilter[] getEnabledFilters()

Gets all the enabled filters.

Return Value

SQLFilter[] The enabled filters.

SQLFilter enable(string $name)

Enables a filter from the collection.

Parameters

string $name Name of the filter.

Return Value

SQLFilter The enabled filter.

Exceptions

InvalidArgumentException If the filter does not exist.

SQLFilter disable(string $name)

Disables a filter.

Parameters

string $name Name of the filter.

Return Value

SQLFilter The disabled filter.

Exceptions

InvalidArgumentException If the filter does not exist.

SQLFilter getFilter(string $name)

Gets an enabled filter from the collection.

Parameters

string $name Name of the filter.

Return Value

SQLFilter The filter.

Exceptions

InvalidArgumentException If the filter is not enabled.

bool has(string $name)

Checks whether filter with given name is defined.

Parameters

string $name Name of the filter.

Return Value

bool true if the filter exists, false if not.

bool isEnabled(string $name)

Checks if a filter is enabled.

Parameters

string $name Name of the filter.

Return Value

bool True if the filter is enabled, false otherwise.

bool isClean()

Return Value

bool True, if the filter collection is clean.

string getHash()

Generates a string of currently enabled filters to use for the cache id.

Return Value

string

setFiltersStateDirty()

Sets the filter state to dirty.