abstract class BsonFilter (View source)

The base class that user defined filters should extend.

Handles the setting and escaping of parameters.

Properties

protected DocumentManager $dm
protected array $parameters Parameters for the filter.

Methods

__construct(DocumentManager $dm)

No description

setParameter(string $name, $value)

Sets a parameter that can be used by the filter.

mixed
getParameter(string $name)

Gets a parameter to use in a query.

addFilterCriteria(ClassMetadata $class)

Gets the criteria array to add to a query.

Details

final __construct(DocumentManager $dm)

Parameters

DocumentManager $dm

final setParameter(string $name, $value)

Sets a parameter that can be used by the filter.

Parameters

string $name
$value

final mixed getParameter(string $name)

Gets a parameter to use in a query.

These are not like SQL parameters. These parameters can hold anything, even objects. They are not automatically injected into a query, they are to be used in the addFilterCriteria method.

Parameters

string $name

Return Value

mixed The parameter.

abstract addFilterCriteria(ClassMetadata $class)

Gets the criteria array to add to a query.

If there is no criteria for the class, an empty array should be returned.

Parameters

ClassMetadata $class