class FilterCollection (View source)

Collection class for all the query filters.

Methods

__construct(DocumentManager $dm, CriteriaMerger|null $cm = null)

No description

getEnabledFilters()

Get all the enabled filters.

enable(string $name)

Enables a filter from the collection.

disable(string $name)

Disables a filter.

getFilter(string $name)

Get an enabled filter from the collection.

bool
has(string $name)

Checks whether filter with given name is defined.

isEnabled(string $name)

Checks whether filter with given name is enabled.

getFilterCriteria(ClassMetadata $class)

Gets enabled filter criteria.

Details

__construct(DocumentManager $dm, CriteriaMerger|null $cm = null)

Parameters

DocumentManager $dm
CriteriaMerger|null $cm

BsonFilter[] getEnabledFilters()

Get all the enabled filters.

Return Value

BsonFilter[]

enable(string $name)

Enables a filter from the collection.

Parameters

string $name

Exceptions

InvalidArgumentException If the filter does not exist.

disable(string $name)

Disables a filter.

Parameters

string $name

Exceptions

InvalidArgumentException If the filter does not exist.

getFilter(string $name)

Get an enabled filter from the collection.

Parameters

string $name

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.

isEnabled(string $name)

Checks whether filter with given name is enabled.

Parameters

string $name

getFilterCriteria(ClassMetadata $class)

Gets enabled filter criteria.

Parameters

ClassMetadata $class