CompositeExpression
in package
implements
Countable
Composite expression is responsible to build a group of similar expression.
Tags
Interfaces, Classes and Traits
- Countable
Table of Contents
- TYPE_AND = 'AND'
- Constant that represents an AND composite expression.
- TYPE_OR = 'OR'
- Constant that represents an OR composite expression.
- $parts : array<string|int, mixed>
- Each expression part of the composite expression.
- $type : string
- The instance type of composite expression.
- __construct() : mixed
- Constructor.
- __toString() : string
- Retrieves the string representation of this composite expression.
- add() : CompositeExpression
- Adds an expression to composite expression.
- addMultiple() : CompositeExpression
- Adds multiple parts to composite expression.
- count() : int
- Retrieves the amount of expressions on composite expression.
- getType() : string
- Returns the type of this composite expression (AND/OR).
Constants
TYPE_AND
Constant that represents an AND composite expression.
public
mixed
TYPE_AND
= 'AND'
TYPE_OR
Constant that represents an OR composite expression.
public
mixed
TYPE_OR
= 'OR'
Properties
$parts
Each expression part of the composite expression.
private
array<string|int, mixed>
$parts
= array()
$type
The instance type of composite expression.
private
string
$type
Methods
__construct()
Constructor.
public
__construct(string $type[, array<string|int, mixed> $parts = array() ]) : mixed
Parameters
- $type : string
-
Instance type of composite expression.
- $parts : array<string|int, mixed> = array()
-
Composition of expressions to be joined on composite expression.
Return values
mixed —__toString()
Retrieves the string representation of this composite expression.
public
__toString() : string
Return values
string —add()
Adds an expression to composite expression.
public
add(mixed $part) : CompositeExpression
Parameters
- $part : mixed
Return values
CompositeExpression —addMultiple()
Adds multiple parts to composite expression.
public
addMultiple([array<string|int, mixed> $parts = array() ]) : CompositeExpression
Parameters
- $parts : array<string|int, mixed> = array()
Return values
CompositeExpression —count()
Retrieves the amount of expressions on composite expression.
public
count() : int
Return values
int —getType()
Returns the type of this composite expression (AND/OR).
public
getType() : string