final class UpsertOperator

What one operator stands for, once its operands have been worked out.

An expression is a tree, and walking it is one job; saying what a plus or a comparison means over two values it has already reached is another. This is the second, so that neither the walk nor any one operator has to know about the rest.

Type Aliases§

RowValue = import from TableDefinition

Methods§

public function __construct(
    private UpsertNumber $numbers = new \ZtdQuery\Shadow\Mutation\Upsert\UpsertNumber(),
    private UpsertComparison $comparisons = new \ZtdQuery\Shadow\Mutation\Upsert\UpsertComparison(),
    private UpsertTruth $truth = new \ZtdQuery\Shadow\Mutation\Upsert\UpsertTruth(),
)
public function apply(
    UpsertExpressionKind $kind,
    mixed $left,
    mixed $right,
): int|float|bool|null

Answers what an operator stands for over the values it was written between.

Parameters

$kindUpsertExpressionKindOperator to apply
$leftmixedValue on its left, or its only value
$rightmixedValue on its right, and null where it has only one

Returns

int|float|bool|null What the operator stands for, and null where it stands for nothing knowable

Throws

InvalidDefinitionException When the kind names no operator at all
UnsupportedSqlException When a value is not something the operator can be applied to
Test cases 3
Called from 1
Calls 36

Private surface 3§

Implementation details, listed for orientation only.

private UpsertNumber $numbers = new \ZtdQuery\Shadow\Mutation\Upsert\UpsertNumber()
private UpsertComparison $comparisons = new \ZtdQuery\Shadow\Mutation\Upsert\UpsertComparison()
private UpsertTruth $truth = new \ZtdQuery\Shadow\Mutation\Upsert\UpsertTruth()

Test cases 9§

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

Dedicated tests 3
Other tests reaching this symbol 6

Relations§

Instantiated in 1
Method calls 1
Type declarations 1