<?php declare(strict_types=1); namespace Doctrine\DBAL\Driver; /** @internal */ final class FetchUtils { /** * @return mixed|false * * @throws Exception */ public static function fetchOne(Result $result) { $row = $result->fetchNumeric(); if ($row === false) { return false; } return $row[0]; } /** * @return list<list<mixed>> * * @throws Exception */ public static function fetchAllNumeric(Result $result): array { $rows = []; while (($row = $result->fetchNumeric()) !== false) { $rows[] = $row; } return $rows; } /** * @return list<array<string,mixed>> * * @throws Exception */ public static function fetchAllAssociative(Result $result): array { $rows = []; while (($row = $result->fetchAssociative()) !== false) { $rows[] = $row; } return $rows; } /** * @return list<mixed> * * @throws Exception */ public static function fetchFirstColumn(Result $result): array { $rows = []; while (($row = $result->fetchOne()) !== false) { $rows[] = $row; } return $rows; } }
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
API | Folder | 0755 |
|
|
AbstractOracleDriver | Folder | 0755 |
|
|
AbstractSQLServerDriver | Folder | 0755 |
|
|
AbstractSQLiteDriver | Folder | 0755 |
|
|
Exception | Folder | 0755 |
|
|
IBMDB2 | Folder | 0755 |
|
|
Middleware | Folder | 0755 |
|
|
Mysqli | Folder | 0755 |
|
|
OCI8 | Folder | 0755 |
|
|
PDO | Folder | 0755 |
|
|
PgSQL | Folder | 0755 |
|
|
SQLSrv | Folder | 0755 |
|
|
SQLite3 | Folder | 0755 |
|
|
AbstractDB2Driver.php | File | 1.4 KB | 0644 |
|
AbstractException.php | File | 1.05 KB | 0644 |
|
AbstractMySQLDriver.php | File | 6.11 KB | 0644 |
|
AbstractOracleDriver.php | File | 1.81 KB | 0644 |
|
AbstractPostgreSQLDriver.php | File | 2.7 KB | 0644 |
|
AbstractSQLServerDriver.php | File | 1.52 KB | 0644 |
|
AbstractSQLiteDriver.php | File | 1.39 KB | 0644 |
|
Connection.php | File | 1.89 KB | 0644 |
|
Exception.php | File | 404 B | 0644 |
|
FetchUtils.php | File | 1.27 KB | 0644 |
|
Middleware.php | File | 168 B | 0644 |
|
Result.php | File | 2.44 KB | 0644 |
|
ServerInfoAwareConnection.php | File | 543 B | 0644 |
|
Statement.php | File | 3.89 KB | 0644 |
|