classPdoStatement
final class PdoStatement
implements StatementInterface
Restricted visibility: declared "@visibility ZtdQuery\Adapter\Pdo". Code outside that scope must not name this declaration.
PDO statement implementing StatementInterface for ZTD layer.
This class wraps a PDOStatement and provides the minimal interface required by the ZTD session for executing statements and fetching results.
Methods§
public function __construct(PDOStatement $statement)Binds the instance to what it will work from.
Parameters
$statement | PDOStatement |
public function execute(?array $params = null): bool{@inheritDoc}
Parameters
$params | ?array |
Returns
boolThrows
DatabaseException On database error when PDO is in exception mode.Test cases 2
Calls 3
- method-call
PDOStatement::execute()line 46 - new DatabaseException line 48
- function-call
is_intline 50
public function fetchAll(): array{@inheritDoc}
Returns
arrayThrows
DatabaseException When the native driver returns an invalid row.Test cases 3
Called from 1
Calls 4
- method-call
PDOStatement::fetch()line 65 - class-const
PDO::FETCH_ASSOC()line 65 - function-call
is_arrayline 66 - new DatabaseException line 67
public function resultColumns(ResultColumnTypeResolver $typeResolver): array{@inheritDoc}
Parameters
$typeResolver | ResultColumnTypeResolver |
Returns
arrayTest cases 1
Called from 1
Calls 5
- method-call
PDOStatement::columnCount()line 85 - method-call
PDOStatement::getColumnMeta()line 86 - function-call
is_arrayline 87 - new ResultColumn line 91
- method-call ResultColumnTypeResolver::resolve() line 93
public function rowCount(): intPrivate surface 1§
Implementation details, listed for orientation only.
private PDOStatement $statementTest cases 16§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 8
PdoStatementTest::testExecutePreservesTheNativeFailureDetailscallsPdoStatementTest::testExecuteReturnsTrueOnSuccesscallsPdoStatementTest::testFetchAllPreservesNativeColumnCaseAndDuplicateLabelscallsPdoStatementTest::testFetchAllPreservesNumericColumnLabelsAndValueTypescallsPdoStatementTest::testFetchAllReturnsAssociativeArrayscallsPdoStatementTest::testImplementsStatementInterfacecallsPdoStatementTest::testResultColumnsDelegateTypesForEmptyResultcallsPdoStatementTest::testRowCountReturnsAffectedRowscalls
Other tests reaching this symbol 8
PdoConnectionTestcallsDriverSessionFactoryTestcallsParameterBinderTestcallsPreparedQueryTestcallsStatementExecutionTestcallsZtdPdoExceptionTestcallsZtdPdoStatementTestcallsZtdPdoTestcalls
Relations§
Instantiated in 3
- new ZtdQuery\Adapter\Pdo\Driver\PdoConnection::query() packages/ztd-query-pdo-adapter/src/Driver/PdoConnection.php:48
- new ZtdQuery\Adapter\Pdo\Session\StatementExecution::fetchAll() packages/ztd-query-pdo-adapter/src/Session/StatementExecution.php:127
- new ZtdQuery\Adapter\Pdo\Session\StatementExecution::resultColumns() packages/ztd-query-pdo-adapter/src/Session/StatementExecution.php:135