NotBetween
extends AbstractPredicate
in package
Not Between predicate class
Tags
Table of Contents
Properties
- $conjunction : string
- Conjunction
- $format : string|null
- Format
- $values : mixed
- Values
Methods
- __construct() : mixed
- Constructor
- getConjunction() : string
- Get the conjunction
- getFormat() : string
- Get the format
- getValues() : mixed
- Get the values
- render() : string
- Render the predicate string
- setConjunction() : AbstractPredicate
- Get the conjunction
- setValues() : AbstractPredicate
- Set values
- assertNoSubqueryAlias() : void
- Assert that a nested Sql instance used as a subquery value has no alias set.
- renderJsonValue() : string
- Render a JSON path comparison value
- renderValue() : string
- Render a single predicate value: a nested Select/Sql instance embeds as a parenthesized subquery, anything else quotes as a literal/placeholder as before
Properties
$conjunction
Conjunction
protected
string
$conjunction
= 'AND'
$format
Format
protected
string|null
$format
= null
$values
Values
protected
mixed
$values
= null
Methods
__construct()
Constructor
public
__construct(array<string|int, mixed> $values[, string $conjunction = 'AND' ]) : mixed
Instantiate the NOT BETWEEN predicate set object
Parameters
- $values : array<string|int, mixed>
- $conjunction : string = 'AND'
Tags
getConjunction()
Get the conjunction
public
getConjunction() : string
Return values
stringgetFormat()
Get the format
public
getFormat() : string
Return values
stringgetValues()
Get the values
public
getValues() : mixed
render()
Render the predicate string
public
render(AbstractSql $sql) : string
Parameters
- $sql : AbstractSql
Tags
Return values
stringsetConjunction()
Get the conjunction
public
setConjunction(string $conjunction) : AbstractPredicate
Parameters
- $conjunction : string
Tags
Return values
AbstractPredicatesetValues()
Set values
public
setValues(mixed $values) : AbstractPredicate
Parameters
- $values : mixed
Return values
AbstractPredicateassertNoSubqueryAlias()
Assert that a nested Sql instance used as a subquery value has no alias set.
protected
static assertNoSubqueryAlias(AbstractSql $value) : void
An aliased Select renders itself as "(SELECT ...) AS alias", which is only valid
in a FROM/JOIN context. Embedded inside a predicate it would produce silently
invalid SQL, so reject it up front with a clear error.
Parameters
- $value : AbstractSql
Tags
renderJsonValue()
Render a JSON path comparison value
protected
static renderJsonValue(AbstractSql $sql, string|null $column, mixed $value) : string
PostgreSQL's JSON extraction operators ('->>' / '#>>') always return text, and PostgreSQL has no implicit text-to-number comparison: a bare numeric literal on the right-hand side fails at execution time with "operator does not exist: text = integer". So on PostgreSQL a plain scalar value is forced to a quoted text literal, which compares correctly against the extracted text. Two cases must NOT be force-quoted and are handed to renderValue() unchanged: a nested Sql instance (which embeds as a parenthesized subquery), and a bound parameter placeholder token (which the database binds as text anyway).
Parameters
- $sql : AbstractSql
- $column : string|null
- $value : mixed
Tags
Return values
stringrenderValue()
Render a single predicate value: a nested Select/Sql instance embeds as a parenthesized subquery, anything else quotes as a literal/placeholder as before
protected
static renderValue(AbstractSql $sql, mixed $value) : string
Parameters
- $sql : AbstractSql
- $value : mixed