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

Coordinates native connection execution with its shadow session.

Methods§

public function __construct(
    private PDO $pdo,
    ?ZtdConfig $config = null,
    ?SessionFactory $factory = null,
)

Create a shadow session for the supplied native connection.

Parameters

$pdoPDO
$config?ZtdConfig
$factory?SessionFactory
Calls 4
public function prepare<TOption>(
    string $query,
    array<TOption> $options,
    Closure(PDOStatement, Session, RewritePlan, PreparedQuery, int): PDOStatement $wrap,
): PDOStatement|false

Prepare native SQL and let the facade wrap the resulting execution plan.

Parameters

$querystring
$optionsarray<TOption>Opaque options forwarded to the native driver.
$wrapClosure(PDOStatement, Session, RewritePlan, PreparedQuery, int): PDOStatement

Returns

PDOStatement|false

Throws

ZtdPdoException When rewriting cannot prepare the statement.
Test cases 1
Called from 1
Calls 11
public function query<TFetchArgument>(
    string $query,
    ?int $fetchMode,
    array<TFetchArgument> $fetchModeArgs,
    Closure(string): PDOStatement|false $prepare,
): PDOStatement|false

Execute a query through the facade's preparation dispatch.

Parameters

$querystring
$fetchMode?int
$fetchModeArgsarray<TFetchArgument>Native fetch options.
$prepareClosure(string): PDOStatement|false

Returns

PDOStatement|false
Test cases 1
Called from 1
Calls 4
public function exec(string $statement, Closure(string): int|false $execute): int|false

Execute statements and synchronize native transaction and shadow state.

Parameters

$statementstring
$executeClosure(string): int|falsePreserve facade dispatch for each batch statement.

Returns

int|false

Throws

ZtdPdoException When shadow execution rejects the SQL.
Test cases 2
Called from 1
Calls 8
public function commit(): bool
public function rollBack(): bool
public function lastInsertId(?string $name = null): string|false

Prefer the shadow-generated key when ZTD handles an unnamed sequence.

Parameters

$name?string

Returns

string|false
Test cases 1
Called from 1
Calls 3

Private surface 2§

Implementation details, listed for orientation only.

private Session $session
private PDO $pdo

Test cases 18§

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

Dedicated tests 9
Other tests reaching this symbol 9

Relations§

Instantiated in 2
Method calls 16
Type declarations 1