class FilterCollection (View source)

Collection class for all the query filters.

Methods

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

Constructor.

array
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.

bool
isEnabled(string $name)

Checks whether filter with given name is enabled.

array
getFilterCriteria(ClassMetadata $class)

Gets enabled filter criteria.

Details

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

Constructor.

Parameters

DocumentManager $dm
CriteriaMerger $cm

array getEnabledFilters()

Get all the enabled filters.

Return Value

array The enabled filters.

BsonFilter enable(string $name)

Enables a filter from the collection.

Parameters

string $name Name of the filter.

Return Value

BsonFilter The enabled filter.

Exceptions

InvalidArgumentException If the filter does not exist.

BsonFilter disable(string $name)

Disables a filter.

Parameters

string $name Name of the filter.

Return Value

BsonFilter The disabled filter.

Exceptions

InvalidArgumentException If the filter does not exist.

BsonFilter getFilter(string $name)

Get an enabled filter from the collection.

Parameters

string $name Name of the filter.

Return Value

BsonFilter 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 whether filter with given name is enabled.

Parameters

string $name Name of the filter

Return Value

bool

array getFilterCriteria(ClassMetadata $class)

Gets enabled filter criteria.

Parameters

ClassMetadata $class

Return Value

array