ValueEquality
Columns of different types compare in one type: numbers widen to float, dates to datetime, strings cast or throw.
Methods
- cast() : Column
- $column's values in $type, built on PhpBackend: a cast column never leaves this class and its physicals go straight back to PHP, so a native build would only add a copy.
- equal() : array<int, bool|null>
- identical() : array<int, bool>
- PHP identity on the comparable form, never across types: null === null.
- in() : array<int, bool|null>
- SQL IN, an OR of equal() over each row's candidates: a candidate that does not cast to the type it compares in with its needle throws, even beside a match.
- number() : int|float
- An integer target rounds a numeric string half away from zero.
- type() : Type<string|int, mixed>
- The one type a pair compares in.
Methods
cast()
$column's values in $type, built on PhpBackend: a cast column never leaves this class and its physicals go straight back to PHP, so a native build would only add a copy.
public
cast(Column $column, Type<string|int, mixed> $type, string $name) : Column
Parameters
- $column : Column
- $type : Type<string|int, mixed>
- $name : string
Return values
Columnequal()
public
equal(Column $left, Column $right[, string $leftName = 'left' ][, string $rightName = 'right' ]) : array<int, bool|null>
Parameters
Return values
array<int, bool|null> —null where either value is null
identical()
PHP identity on the comparable form, never across types: null === null.
public
identical(Column $left, Column $right) : array<int, bool>
Parameters
Return values
array<int, bool>in()
SQL IN, an OR of equal() over each row's candidates: a candidate that does not cast to the type it compares in with its needle throws, even beside a match.
public
in(Column $needles, array<int, array<string|int, mixed>|null> $candidates, string $needleName, string $haystackName) : array<int, bool|null>
Parameters
- $needles : Column
- $candidates : array<int, array<string|int, mixed>|null>
-
one haystack per needle row, null for a null haystack
- $needleName : string
- $haystackName : string
Return values
array<int, bool|null> —null for a null needle or haystack, and for no match beside a null candidate
number()
An integer target rounds a numeric string half away from zero.
public
number(string $value, IntegerType|FloatType $type) : int|float
Parameters
- $value : string
- $type : IntegerType|FloatType
Return values
int|floattype()
The one type a pair compares in.
public
type(Type<string|int, mixed> $left, Type<string|int, mixed> $right) : Type<string|int, mixed>
Parameters
- $left : Type<string|int, mixed>
- $right : Type<string|int, mixed>