Documentation

CompositeExpression
in package
implements Countable

Composite expression is responsible to build a group of similar expression.

Table of Contents

Interfaces

Countable

Constants

TYPE_AND  = 'AND'
Constant that represents an AND composite expression.
TYPE_OR  = 'OR'
Constant that represents an OR composite expression.

Properties

$parts  : array<string|int, self>|array<string|int, string>
Each expression part of the composite expression.
$type  : string
The instance type of composite expression.

Methods

__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.
and()  : self
count()  : int
Retrieves the amount of expressions on composite expression.
getType()  : string
Returns the type of this composite expression (AND/OR).
or()  : self
with()  : self
Returns a new CompositeExpression with the given parts added.

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, self>|array<string|int, string> $parts = []

Methods

__toString()

Retrieves the string representation of this composite expression.

public __toString() : string
Return values
string

addMultiple()

Adds multiple parts to composite expression.

public addMultiple([array<string|int, self>|array<string|int, string> $parts = [] ]) : CompositeExpression
Parameters
$parts : array<string|int, self>|array<string|int, string> = []
Tags
deprecated

This class will be made immutable. Use with() instead.

Return values
CompositeExpression

and()

public static and(self|string $part, self|string ...$parts) : self
Parameters
$part : self|string
$parts : self|string
Return values
self

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
Return values
string

or()

public static or(self|string $part, self|string ...$parts) : self
Parameters
$part : self|string
$parts : self|string
Return values
self

with()

Returns a new CompositeExpression with the given parts added.

public with(self|string $part, self|string ...$parts) : self
Parameters
$part : self|string
$parts : self|string
Return values
self

        
On this page

Search results