Predicate
+ Inheritance diagram for Predicate:

Description

A logical expression that evaluates to a boolean.

Public Static Methods

static self match (DB $db, $a, $b)
 Null-safe equality Predicate from mixed arguments. More...
 
- Public Static Methods inherited from Expression
magic static self factory (DB $db, string $expression)
 

Public Methods

Predicate lAnd (string ... $predicates)
 Logical AND More...
 
self lNot ()
 Logical NOT More...
 
Predicate lOr (string ... $predicates)
 Logical OR More...
 
- Public Methods inherited from Expression
 __construct (DB $db, string $expression)
 
string __toString ()
 

Additional Inherited Members

- Protected Properties inherited from Expression
DB $db
 
string $expression
 

Methods

◆ lAnd()

Predicate lAnd ( string ...  $predicates)

Logical AND

($this AND ...)

Parameters
string...$predicates
Returns
Predicate

◆ lNot()

self lNot ( )

Logical NOT

NOT($this)

Returns
self

◆ lOr()

Predicate lOr ( string ...  $predicates)

Logical OR

($this OR ...)

Parameters
string...$predicates
Returns
Predicate

◆ match()

static self match ( DB  $db,
  $a,
  $b 
)
static

Null-safe equality Predicate from mixed arguments.

If $a is an integer (enumerated item), returns $b as a Predicate

If $b is a closure, returns from $b($a, DB $this)

If $b is an EntityInterface, the ID is used.

If $b is an array, returns $a IN (...quoted $b)

If $b is a Select, returns $a IN ($b->toSql())

Otherwise predicates upon $a = quoted $b

Parameters
scalar$a
null | scalar | array | Closure | EntityInterface | Select | ValueInterface$b
Returns
self