PHP Class MetaModels\Filter\Rules\Condition\ConditionOr

Inheritance: extends MetaModels\Filter\FilterRule
Show file Open project: metamodels/core Class Usage Examples

Protected Properties

Property Type Description
$arrChildFilters MetaModels\Filter\IFilter[] The list of child filters that shall be evaluated.
$stopAfterMatch boolean This flag determines if the rule shall return the result of the first child that returns at least one element (a return value of NULL from a rule counts as "all ids" in this context and therefore is considered non empty per definition).

Public Methods

Method Description
__construct ( boolean $stopAfterMatch = false ) Create a new FilterRule instance.
addChild ( MetaModels\Filter\IFilter $objFilter ) : ConditionOr Adds a child filter to this rule that will get evaluated when this rule is evaluated.
getMatchingIds ( ) : string[] | null Fetch the ids from all child filter rules.

Method Details

__construct() public method

Create a new FilterRule instance.
public __construct ( boolean $stopAfterMatch = false )
$stopAfterMatch boolean Flag determining if filtering shall return the first non-empty match.

addChild() public method

Adds a child filter to this rule that will get evaluated when this rule is evaluated.
public addChild ( MetaModels\Filter\IFilter $objFilter ) : ConditionOr
$objFilter MetaModels\Filter\IFilter The filter to add as child.
return ConditionOr

getMatchingIds() public method

If no entries have been found, the result is an empty array. If no filtering was applied and therefore all ids shall be reported as valid, the return value of NULL is allowed. The OR filter rule has an embedded shortcut for the first rule that returns "null". When this happens, no further child rules will get evaluated, as the result set can not expand any further. Note: when "stopAfterMatch" has been set, the rule will stop processing also when the first rule returns a non empty result and return that result.
public getMatchingIds ( ) : string[] | null
return string[] | null

Property Details

$arrChildFilters protected property

The list of child filters that shall be evaluated.
protected IFilter[],MetaModels\Filter $arrChildFilters
return MetaModels\Filter\IFilter[]

$stopAfterMatch protected property

This flag determines if the rule shall return the result of the first child that returns at least one element (a return value of NULL from a rule counts as "all ids" in this context and therefore is considered non empty per definition).
protected bool $stopAfterMatch
return boolean