AndCriteria
extends LogicBase
in package
implements
ICriteria
Abstract base class for implementing the Criteria pattern.
This class provides the foundation for creating composable criteria objects that can be combined using logical operators (AND, OR, NOT). The Criteria pattern allows for flexible, reusable, and chainable query conditions.
Concrete implementations should define the meetCriteria() method to specify the actual filtering logic. This base class provides the logical composition methods for building complex criteria chains.
The pattern enables:
- Composable query logic through method chaining
- Reusable criteria components across different contexts
- Clear separation of individual criteria concerns
- Dynamic query building at runtime
Table of Contents
Interfaces
- ICriteria
- Criteria pattern interface for entity filtering and selection.
Properties
- $_criteria : mixed
- $_otherCriteria : mixed
Methods
- __construct() : mixed
- AndCriteria constructor.
- _and() : AndCriteria
- Creates an AND combination of this criteria with another criteria.
- _not() : NotCriteria
- Creates a NOT (negation) of this criteria.
- _or() : OrCriteria
- Creates an OR combination of this criteria with another criteria.
- meetCriteria() : array<string|int, mixed>
Properties
$_criteria
protected
mixed
$_criteria
$_otherCriteria
protected
mixed
$_otherCriteria
Methods
__construct()
AndCriteria constructor.
public
__construct(ICriteria $criteria, ICriteria $otherCriteria) : mixed
Parameters
_and()
Creates an AND combination of this criteria with another criteria.
public
_and(ICriteria $otherCriteria) : AndCriteria
Parameters
- $otherCriteria : ICriteria
-
The criteria to combine with using AND logic
Return values
AndCriteria —A new criteria that represents this AND other
_not()
Creates a NOT (negation) of this criteria.
public
_not() : NotCriteria
Return values
NotCriteria —A new criteria that represents the negation of this criteria
_or()
Creates an OR combination of this criteria with another criteria.
public
_or(ICriteria $otherCriteria) : OrCriteria
Parameters
- $otherCriteria : ICriteria
-
The criteria to combine with using OR logic
Return values
OrCriteria —A new criteria that represents this OR other
meetCriteria()
public
meetCriteria(array<string|int, mixed> $entities) : array<string|int, mixed>
Parameters
- $entities : array<string|int, mixed>