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

Coordinates native connection execution with its shadow session.

Methods§

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

Create a shadow session for the supplied native connection.

Parameters

$mysqlimysqli
$config?ZtdConfig
$factory?SessionFactory
Calls 3
public function native(): mysqli

Return the wrapped native connection.

Returns

mysqli
Test cases 1
Called from 34
public function simulatedAffectedRows(): ?int
public function prepare(
    string $query,
    Closure(mysqli_stmt, Session, RewritePlan): mysqli_stmt $wrap,
): mysqli_stmt|false

Prepare rewritten SQL and let the facade wrap the native statement.

Parameters

$querystring
$wrapClosure(mysqli_stmt, Session, RewritePlan): mysqli_stmt

Returns

mysqli_stmt|false

Throws

ZtdMysqliException When ZTD-specific exception occurs (wraps DatabaseException).
Test cases 1
Called from 1
Calls 4
public function query(
    string $query,
    int $resultMode,
    Closure(string): mysqli_result|bool $execute,
): mysqli_result|bool

Synchronize transaction queries before dispatching statement execution.

Parameters

$querystring
$resultModeint
$executeClosure(string): mysqli_result|bool

Returns

mysqli_result|bool
Test cases 1
Called from 1
Calls 4
public function realQuery(string $query, Closure(string): mysqli_stmt|false $prepare): bool

Apply transaction state after successful native execution.

Parameters

$querystring
$prepareClosure(string): mysqli_stmt|false

Returns

bool
Test cases 2
Called from 1
Calls 4
public function commit(int $flags = 0, ?string $name = null): bool

Synchronize native execution with shadow transaction state.

Parameters

$flagsint
$name?string

Returns

bool
Test cases 2
Called from 1
Calls 2
public function autocommit(bool $enable): bool

Synchronize native execution with shadow transaction state.

Parameters

$enablebool

Returns

bool
Test cases 1
Called from 1
Calls 3
public function releaseSavepoint(string $name): bool

Synchronize native execution with shadow transaction state.

Parameters

$namestring

Returns

bool
Test cases 1
Called from 1
Calls 3
public function savepoint(string $name): bool
public function executeQuery<TParameter>(
    string $query,
    array<TParameter>|null $params,
    Closure(string): mysqli_stmt|false $prepare,
    Closure(mysqli_stmt): ?int $affectedRows,
): mysqli_result|bool

Execute through the facade while retaining the simulated affected-row count.

Parameters

$querystring
$paramsarray<TParameter>|null
$prepareClosure(string): mysqli_stmt|false
$affectedRowsClosure(mysqli_stmt): ?int

Returns

mysqli_result|bool
Test cases 1
Called from 1
public function affectedRows(): int

Get the affected row count from the last ZTD or regular operation.

Note: Direct property access ($this->affected_rows) is not supported because PHP's C extension property handler for mysqli takes precedence over __get when the parent constructor was not called. Use this method instead.

Returns

int
Test cases 1
Called from 1

Private surface 3§

Implementation details, listed for orientation only.

private Session $session
private ?int $ztdAffectedRowCount = null
private mysqli $mysqli

Test cases 30§

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

Dedicated tests 17
Other tests reaching this symbol 13

Relations§

Instantiated in 2
Method calls 49
Type declarations 1