final class ParameterBinder
Restricted visibility: declared "@visibility ZtdQuery\Adapter\Pdo". Code outside that scope must not name this declaration.

Binds a caller's parameters to a statement and runs it.

ZTD rewrites a statement's SQL between prepare and execute, so the array a caller passed to execute() cannot simply be handed on: each value has to be bound to the rewritten statement under the placeholder it belongs to, and under the kind PDO would have read it as.

Methods§

public function execute<TValue>(
    PDOStatement $statement,
    array<int|string, TValue>|null $params,
): bool

Binds every parameter to the statement and runs it.

Positional parameters are numbered from one in the order they were written, which is how PDO numbers them.

Parameters

$statementPDOStatementStatement to bind against and run
$paramsarray<int|string, TValue>|nullParameters as the caller passed them, or null to run what is already bound

Returns

bool Whether the statement ran
Test cases 3
Called from 1
Calls 6
public function parameterName(string $parameter): string

Answers a named parameter as the placeholder it stands for.

A caller may write the name with or without the colon PDO's placeholders carry; both name the same placeholder.

Parameters

$parameterstringName as the caller wrote it

Returns

string The same name, written as a placeholder
Test cases 2
Called from 1
Calls 2

Test cases 13§

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

Dedicated tests 5
Other tests reaching this symbol 8

Relations§

Instantiated in 1
Method calls 1