predicate.php
Table of Contents
Functions
- predicate() : string
- Generate a predicate expression as a string.
Functions
predicate()
Generate a predicate expression as a string.
predicate(mixed $leftOperand[, string|null $operator = null ][, mixed $rightOperand = null ]) : string
This function builds a simple expression in the form:
leftOperand operator rightOperand
.
If the operator is omitted, only the left operand is returned.
Examples:
predicate('age', '>=', 18); // "age >= 18"
predicate('status', 'is not null'); // "status is not null"
predicate('name'); // "name"
Parameters
- $leftOperand : mixed
-
The left-hand value.
- $operator : string|null = null
-
The operator (optional, e.g., '==', '!=', '>=', 'is null').
- $rightOperand : mixed = null
-
The right-hand value (optional).
Tags
Return values
string —The resulting predicate expression.