final class UpsertTruth

Answers whether a value counts as true, in SQL's three-valued logic.

Null is not false: it is unknown, and it stays unknown through NOT. It only stops mattering where the other operand settles the answer on its own — one false makes an AND false, one true makes an OR true — which is what makes these different from PHP's own operators.

Type Aliases§

RowValue = import from TableDefinition

Methods§

public function not(mixed $value): bool|null

Answers the opposite of what a value counts as.

Parameters

$valuemixedValue to read

Returns

bool|null The opposite, or null when the value is unknown

Throws

UnsupportedSqlException When the value is neither boolean nor a number
Test cases 2
Called from 1
Calls 1
public function and(bool|null $left, bool|null $right): bool|null

Answers whether both sides hold.

Parameters

$leftbool|nullLeft operand
$rightbool|nullRight operand

Returns

bool|null Whether both do, or null when that cannot be said
Test cases 3
Called from 1
public function or(bool|null $left, bool|null $right): bool|null

Answers whether either side holds.

Parameters

$leftbool|nullLeft operand
$rightbool|nullRight operand

Returns

bool|null Whether either does, or null when that cannot be said
Test cases 3
Called from 1

Private surface 1§

Implementation details, listed for orientation only.

private UpsertNumber $numbers = new \ZtdQuery\Shadow\Mutation\Upsert\UpsertNumber()

Test cases 19§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 12
Other tests reaching this symbol 7

Relations§

Instantiated in 2
Method calls 6
Type declarations 2