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

Coordinates native execution and shadow post-processing for a prepared statement.

Methods§

public function __construct(
    private mysqli_stmt $delegate,
    private Session $session,
    private ?RewritePlan $plan,
)

Retain the native statement and its shadow execution plan.

Parameters

$delegatemysqli_stmt
$sessionSession
$plan?RewritePlan
public function native(): mysqli_stmt

Return the native statement.

Returns

mysqli_stmt
Test cases 1
Called from 14
public function affectedRows(): int

Get affected rows for ZTD results.

This method exists because mysqli_stmt's C extension property handler takes precedence over __get, making $stmt->affected_rows inaccessible when the parent constructor was not called. This provides a safe alternative for ZtdMysqli to query affected rows after execution.

Returns

int The number of affected rows from ZTD processing, or from the delegate.
Test cases 1
Called from 1
public function execute<TParameter>(array<TParameter>|null $params = null): bool
public function getResult(): mysqli_result|false

Coordinate the native statement with its simulated result.

Returns

mysqli_result|false
Test cases 1
Called from 1
Calls 1
  • method-call mysqli_stmt::get_result() line 109
public function fetch(): ?bool

Coordinate the native statement with its simulated result.

Returns

?bool
Test cases 1
Called from 1
Calls 1
  • method-call mysqli_stmt::fetch() line 123
public function reset(): bool

Coordinate the native statement with its simulated result.

Returns

bool
Test cases 1
Called from 1
Calls 1
  • method-call mysqli_stmt::reset() line 133

Private surface 5§

Implementation details, listed for orientation only.

private ?ExecuteResult $result = null
private mysqli_result|false|null $cachedMysqliResult = null
private mysqli_stmt $delegate
private Session $session
private ?RewritePlan $plan

Test cases 14§

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

Dedicated tests 7
Other tests reaching this symbol 7

Relations§

Instantiated in 1
Method calls 21
Type declarations 1