From 5e8192df0c53cf2ac73d491b3393b27a8875b365 Mon Sep 17 00:00:00 2001 From: Sergei Morozov Date: Fri, 29 May 2020 12:13:35 -0700 Subject: [PATCH 1/3] Make DB2Statement forward-compatible as well --- .../DBAL/Driver/IBMDB2/DB2Statement.php | 54 ++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Statement.php b/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Statement.php index 3a01b3ad9d1..30d7d9b7c8f 100644 --- a/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Statement.php +++ b/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Statement.php @@ -2,9 +2,11 @@ namespace Doctrine\DBAL\Driver\IBMDB2; +use Doctrine\DBAL\Driver\FetchUtils; use Doctrine\DBAL\Driver\Statement; use Doctrine\DBAL\Driver\StatementIterator; use Doctrine\DBAL\FetchMode; +use Doctrine\DBAL\ForwardCompatibility\Driver\ResultStatement as ForwardCompatibleResultStatement; use Doctrine\DBAL\ParameterType; use IteratorAggregate; use PDO; @@ -46,7 +48,7 @@ use const DB2_PARAM_FILE; use const DB2_PARAM_IN; -class DB2Statement implements IteratorAggregate, Statement +class DB2Statement implements IteratorAggregate, Statement, ForwardCompatibleResultStatement { /** @var resource */ private $stmt; @@ -356,6 +358,56 @@ public function fetchColumn($columnIndex = 0) return $row[$columnIndex] ?? null; } + /** + * {@inheritDoc} + */ + public function fetchNumeric() + { + if (! $this->result) { + return false; + } + + return db2_fetch_array($this->stmt); + } + + /** + * {@inheritdoc} + */ + public function fetchAssociative() + { + // do not try fetching from the statement if it's not expected to contain the result + // in order to prevent exceptional situation + if (! $this->result) { + return false; + } + + return db2_fetch_assoc($this->stmt); + } + + /** + * {@inheritdoc} + */ + public function fetchOne() + { + return FetchUtils::fetchOne($this); + } + + /** + * {@inheritdoc} + */ + public function fetchAllNumeric() : array + { + return FetchUtils::fetchAllNumeric($this); + } + + /** + * {@inheritdoc} + */ + public function fetchAllAssociative() : array + { + return FetchUtils::fetchAllAssociative($this); + } + /** * {@inheritdoc} */ From 23e569ea84e89007ac368f4b3040ce1a73fcf083 Mon Sep 17 00:00:00 2001 From: Sergei Morozov Date: Fri, 29 May 2020 11:56:12 -0700 Subject: [PATCH 2/3] Introduce Statement::fetchFirstColumn() --- UPGRADE.md | 2 +- lib/Doctrine/DBAL/Cache/ArrayStatement.php | 8 ++++++ .../DBAL/Cache/ResultCacheStatement.php | 8 ++++++ lib/Doctrine/DBAL/Connection.php | 26 +++++++++++++++++++ lib/Doctrine/DBAL/Driver/FetchUtils.php | 16 ++++++++++++ .../DBAL/Driver/IBMDB2/DB2Statement.php | 8 ++++++ .../DBAL/Driver/Mysqli/MysqliStatement.php | 8 ++++++ .../DBAL/Driver/OCI8/OCI8Statement.php | 8 ++++++ lib/Doctrine/DBAL/Driver/PDOStatement.php | 8 ++++++ .../SQLAnywhere/SQLAnywhereStatement.php | 10 +++++++ .../DBAL/Driver/SQLSrv/SQLSrvStatement.php | 8 ++++++ .../Driver/ResultStatement.php | 9 +++++++ lib/Doctrine/DBAL/Portability/Statement.php | 14 ++++++++++ lib/Doctrine/DBAL/Statement.php | 18 +++++++++++++ .../DBAL/Functional/Connection/FetchTest.php | 9 +++++++ 15 files changed, 159 insertions(+), 1 deletion(-) diff --git a/UPGRADE.md b/UPGRADE.md index 1a5b80cafdc..15f11853f02 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -4,7 +4,7 @@ 1. The `FetchMode` class and the `setFetchMode()` method of the `Connection` and `Statement` interfaces are deprecated. 2. The `Statement::fetch()` method is deprecated in favor of `fetchNumeric()`, `fetchAssociative()` and `fetchOne()`. -3. The `Statement::fetchAll()` method is deprecated in favor of `fetchAllNumeric()` and `fetchAllAssociative()`. There is no currently replacement for `Statement::fetchAll(FETCH_MODE::COLUMN)`. In a future major version, `fetchColumn()` will be used as a replacement. +3. The `Statement::fetchAll()` method is deprecated in favor of `fetchAllNumeric()`, `fetchAllAssociative()` and `fetchFirstColumn()`. 4. The `Statement::fetchColumn()` method is deprecated in favor of `fetchOne()`. 5. The `Connection::fetchArray()` and `fetchAssoc()` method are deprecated in favor of `fetchNumeric()` and `fetchAssociative()` respectively. 6. The `StatementIterator` class and the usage of a `Statement` object as `Traversable` is deprecated in favor of `iterateNumeric()`, `iterateAssociative()` and `iterateColumn()`. diff --git a/lib/Doctrine/DBAL/Cache/ArrayStatement.php b/lib/Doctrine/DBAL/Cache/ArrayStatement.php index 1e17b766e27..aaddf7ec847 100644 --- a/lib/Doctrine/DBAL/Cache/ArrayStatement.php +++ b/lib/Doctrine/DBAL/Cache/ArrayStatement.php @@ -201,6 +201,14 @@ public function fetchAllAssociative() : array return FetchUtils::fetchAllAssociative($this); } + /** + * {@inheritdoc} + */ + public function fetchFirstColumn() : array + { + return FetchUtils::fetchFirstColumn($this); + } + /** * @return mixed|false */ diff --git a/lib/Doctrine/DBAL/Cache/ResultCacheStatement.php b/lib/Doctrine/DBAL/Cache/ResultCacheStatement.php index 5cbb59e337c..dc2f8a0f8c5 100644 --- a/lib/Doctrine/DBAL/Cache/ResultCacheStatement.php +++ b/lib/Doctrine/DBAL/Cache/ResultCacheStatement.php @@ -277,6 +277,14 @@ public function fetchAllAssociative() : array return $this->data; } + /** + * {@inheritdoc} + */ + public function fetchFirstColumn() : array + { + return FetchUtils::fetchFirstColumn($this); + } + /** * Returns the number of rows affected by the last DELETE, INSERT, or UPDATE statement * executed by the corresponding object. diff --git a/lib/Doctrine/DBAL/Connection.php b/lib/Doctrine/DBAL/Connection.php index 3ec360b839a..4319c0688ed 100644 --- a/lib/Doctrine/DBAL/Connection.php +++ b/lib/Doctrine/DBAL/Connection.php @@ -991,6 +991,32 @@ public function fetchAllAssociative(string $query, array $params = [], array $ty } } + /** + * Prepares and executes an SQL query and returns the result as an array of the first column values. + * + * @param string $query The SQL query. + * @param array|array $params The query parameters. + * @param array|array $types The query parameter types. + * + * @return array + * + * @throws DBALException + */ + public function fetchFirstColumn(string $query, array $params = [], array $types = []) : array + { + try { + $stmt = $this->executeQuery($query, $params, $types); + + if ($stmt instanceof ForwardCompatibleResultStatement) { + return $stmt->fetchFirstColumn(); + } + + return $stmt->fetchAll(FetchMode::COLUMN); + } catch (Throwable $e) { + throw DBALException::driverExceptionDuringQuery($this->_driver, $e, $query); + } + } + /** * Prepares and executes an SQL query and returns the result as an iterator over rows represented as numeric arrays. * diff --git a/lib/Doctrine/DBAL/Driver/FetchUtils.php b/lib/Doctrine/DBAL/Driver/FetchUtils.php index 358429255f0..e9054d150f3 100644 --- a/lib/Doctrine/DBAL/Driver/FetchUtils.php +++ b/lib/Doctrine/DBAL/Driver/FetchUtils.php @@ -58,4 +58,20 @@ public static function fetchAllAssociative(ResultStatement $stmt) : array return $rows; } + + /** + * @return array + * + * @throws DriverException + */ + public static function fetchFirstColumn(ResultStatement $stmt) : array + { + $rows = []; + + while (($row = $stmt->fetchOne()) !== false) { + $rows[] = $row; + } + + return $rows; + } } diff --git a/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Statement.php b/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Statement.php index 30d7d9b7c8f..f882bce3b4e 100644 --- a/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Statement.php +++ b/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Statement.php @@ -408,6 +408,14 @@ public function fetchAllAssociative() : array return FetchUtils::fetchAllAssociative($this); } + /** + * {@inheritdoc} + */ + public function fetchFirstColumn() : array + { + return FetchUtils::fetchFirstColumn($this); + } + /** * {@inheritdoc} */ diff --git a/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php b/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php index 88b73de7f07..cec330a4624 100644 --- a/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php +++ b/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php @@ -467,6 +467,14 @@ public function fetchAllAssociative() : array return FetchUtils::fetchAllAssociative($this); } + /** + * {@inheritdoc} + */ + public function fetchFirstColumn() : array + { + return FetchUtils::fetchFirstColumn($this); + } + /** * {@inheritdoc} */ diff --git a/lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php b/lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php index 1be74545b2a..b73287589f7 100644 --- a/lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php +++ b/lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php @@ -591,6 +591,14 @@ public function fetchAllAssociative() : array return $this->doFetchAll(OCI_ASSOC, OCI_FETCHSTATEMENT_BY_ROW); } + /** + * {@inheritdoc} + */ + public function fetchFirstColumn() : array + { + return $this->doFetchAll(OCI_NUM, OCI_FETCHSTATEMENT_BY_COLUMN)[0]; + } + /** * @return mixed|false */ diff --git a/lib/Doctrine/DBAL/Driver/PDOStatement.php b/lib/Doctrine/DBAL/Driver/PDOStatement.php index 1922c4c0e3a..63d023e7eaf 100644 --- a/lib/Doctrine/DBAL/Driver/PDOStatement.php +++ b/lib/Doctrine/DBAL/Driver/PDOStatement.php @@ -240,6 +240,14 @@ public function fetchAllAssociative() : array return $this->fetchAll(PDO::FETCH_ASSOC); } + /** + * {@inheritdoc} + */ + public function fetchFirstColumn() : array + { + return $this->fetchAll(PDO::FETCH_COLUMN); + } + /** * Converts DBAL parameter type to PDO parameter type * diff --git a/lib/Doctrine/DBAL/Driver/SQLAnywhere/SQLAnywhereStatement.php b/lib/Doctrine/DBAL/Driver/SQLAnywhere/SQLAnywhereStatement.php index 74e9b5745ab..d8282870281 100644 --- a/lib/Doctrine/DBAL/Driver/SQLAnywhere/SQLAnywhereStatement.php +++ b/lib/Doctrine/DBAL/Driver/SQLAnywhere/SQLAnywhereStatement.php @@ -368,6 +368,16 @@ public function fetchAllAssociative() : array return FetchUtils::fetchAllAssociative($this); } + /** + * @return array + * + * @throws DriverException + */ + public function fetchFirstColumn() : array + { + return FetchUtils::fetchFirstColumn($this); + } + /** * {@inheritdoc} */ diff --git a/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php b/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php index 8292a62c311..3ac77d6446b 100644 --- a/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php +++ b/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php @@ -476,6 +476,14 @@ public function fetchAllAssociative() : array return FetchUtils::fetchAllAssociative($this); } + /** + * {@inheritdoc} + */ + public function fetchFirstColumn() : array + { + return FetchUtils::fetchFirstColumn($this); + } + /** * {@inheritdoc} */ diff --git a/lib/Doctrine/DBAL/ForwardCompatibility/Driver/ResultStatement.php b/lib/Doctrine/DBAL/ForwardCompatibility/Driver/ResultStatement.php index ef0f88bd511..a6802c8b2f9 100644 --- a/lib/Doctrine/DBAL/ForwardCompatibility/Driver/ResultStatement.php +++ b/lib/Doctrine/DBAL/ForwardCompatibility/Driver/ResultStatement.php @@ -56,4 +56,13 @@ public function fetchAllNumeric() : array; * @throws DriverException */ public function fetchAllAssociative() : array; + + /** + * Returns an array containing the values of the first column of the result set. + * + * @return array + * + * @throws DriverException + */ + public function fetchFirstColumn() : array; } diff --git a/lib/Doctrine/DBAL/Portability/Statement.php b/lib/Doctrine/DBAL/Portability/Statement.php index d2ad241d099..74f2574b47a 100644 --- a/lib/Doctrine/DBAL/Portability/Statement.php +++ b/lib/Doctrine/DBAL/Portability/Statement.php @@ -255,6 +255,20 @@ public function fetchAllAssociative() : array return $this->fixResultSet($data, true, true); } + /** + * {@inheritdoc} + */ + public function fetchFirstColumn() : array + { + if ($this->stmt instanceof ForwardCompatibleResultStatement) { + $data = $this->stmt->fetchFirstColumn(); + } else { + $data = $this->stmt->fetchAll(FetchMode::COLUMN); + } + + return $this->fixResultSet($data, true, false); + } + /** * @param mixed $result * diff --git a/lib/Doctrine/DBAL/Statement.php b/lib/Doctrine/DBAL/Statement.php index 1c593478254..24a88123709 100644 --- a/lib/Doctrine/DBAL/Statement.php +++ b/lib/Doctrine/DBAL/Statement.php @@ -370,6 +370,24 @@ public function fetchAllAssociative() : array } } + /** + * {@inheritdoc} + * + * @throws DBALException + */ + public function fetchFirstColumn() : array + { + try { + if ($this->stmt instanceof ForwardCompatibleResultStatement) { + return $this->stmt->fetchFirstColumn(); + } + + return $this->stmt->fetchAll(FetchMode::COLUMN); + } catch (DriverException $e) { + throw DBALException::driverException($this->conn->getDriver(), $e); + } + } + /** * {@inheritDoc} * diff --git a/tests/Doctrine/Tests/DBAL/Functional/Connection/FetchTest.php b/tests/Doctrine/Tests/DBAL/Functional/Connection/FetchTest.php index 8d4c315670f..b53b0b27509 100644 --- a/tests/Doctrine/Tests/DBAL/Functional/Connection/FetchTest.php +++ b/tests/Doctrine/Tests/DBAL/Functional/Connection/FetchTest.php @@ -76,6 +76,15 @@ public function testFetchAllAssociative() : void ], $this->connection->fetchAllAssociative($this->query)); } + public function testFetchFirstColumn() : void + { + self::assertEquals([ + 'foo', + 'bar', + 'baz', + ], $this->connection->fetchFirstColumn($this->query)); + } + public function testIterateNumeric() : void { self::assertEquals([ From 76a8caecc3d3b3ed9ca3d21f10d4cc354e7655ed Mon Sep 17 00:00:00 2001 From: Sergei Morozov Date: Fri, 29 May 2020 12:16:18 -0700 Subject: [PATCH 3/3] Fix deprecation message for Statement::fetchAll() --- lib/Doctrine/DBAL/Cache/ArrayStatement.php | 2 +- lib/Doctrine/DBAL/Cache/ResultCacheStatement.php | 2 +- lib/Doctrine/DBAL/Driver/IBMDB2/DB2Statement.php | 2 +- lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php | 2 +- lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php | 2 +- lib/Doctrine/DBAL/Driver/PDOStatement.php | 2 +- lib/Doctrine/DBAL/Driver/ResultStatement.php | 2 +- lib/Doctrine/DBAL/Driver/SQLAnywhere/SQLAnywhereStatement.php | 2 +- lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php | 2 +- lib/Doctrine/DBAL/Portability/Statement.php | 2 +- lib/Doctrine/DBAL/Statement.php | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/Doctrine/DBAL/Cache/ArrayStatement.php b/lib/Doctrine/DBAL/Cache/ArrayStatement.php index aaddf7ec847..bc3345e568e 100644 --- a/lib/Doctrine/DBAL/Cache/ArrayStatement.php +++ b/lib/Doctrine/DBAL/Cache/ArrayStatement.php @@ -124,7 +124,7 @@ public function fetch($fetchMode = null, $cursorOrientation = PDO::FETCH_ORI_NEX /** * {@inheritdoc} * - * @deprecated Use fetchAllNumeric(), fetchAllAssociative() or fetchColumn() instead. + * @deprecated Use fetchAllNumeric(), fetchAllAssociative() or fetchFirstColumn() instead. */ public function fetchAll($fetchMode = null, $fetchArgument = null, $ctorArgs = null) { diff --git a/lib/Doctrine/DBAL/Cache/ResultCacheStatement.php b/lib/Doctrine/DBAL/Cache/ResultCacheStatement.php index dc2f8a0f8c5..53d43117ef3 100644 --- a/lib/Doctrine/DBAL/Cache/ResultCacheStatement.php +++ b/lib/Doctrine/DBAL/Cache/ResultCacheStatement.php @@ -176,7 +176,7 @@ public function fetch($fetchMode = null, $cursorOrientation = PDO::FETCH_ORI_NEX /** * {@inheritdoc} * - * @deprecated Use fetchAllNumeric(), fetchAllAssociative() or fetchColumn() instead. + * @deprecated Use fetchAllNumeric(), fetchAllAssociative() or fetchFirstColumn() instead. */ public function fetchAll($fetchMode = null, $fetchArgument = null, $ctorArgs = null) { diff --git a/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Statement.php b/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Statement.php index f882bce3b4e..488053865f7 100644 --- a/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Statement.php +++ b/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Statement.php @@ -312,7 +312,7 @@ public function fetch($fetchMode = null, $cursorOrientation = PDO::FETCH_ORI_NEX /** * {@inheritdoc} * - * @deprecated Use fetchAllNumeric(), fetchAllAssociative() or fetchColumn() instead. + * @deprecated Use fetchAllNumeric(), fetchAllAssociative() or fetchFirstColumn() instead. */ public function fetchAll($fetchMode = null, $fetchArgument = null, $ctorArgs = null) { diff --git a/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php b/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php index cec330a4624..21a41e7e7b0 100644 --- a/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php +++ b/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php @@ -362,7 +362,7 @@ public function fetch($fetchMode = null, $cursorOrientation = PDO::FETCH_ORI_NEX /** * {@inheritdoc} * - * @deprecated Use fetchAllNumeric(), fetchAllAssociative() or fetchColumn() instead. + * @deprecated Use fetchAllNumeric(), fetchAllAssociative() or fetchFirstColumn() instead. */ public function fetchAll($fetchMode = null, $fetchArgument = null, $ctorArgs = null) { diff --git a/lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php b/lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php index b73287589f7..278d9f2b681 100644 --- a/lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php +++ b/lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php @@ -468,7 +468,7 @@ public function fetch($fetchMode = null, $cursorOrientation = PDO::FETCH_ORI_NEX /** * {@inheritdoc} * - * @deprecated Use fetchAllNumeric(), fetchAllAssociative() or fetchColumn() instead. + * @deprecated Use fetchAllNumeric(), fetchAllAssociative() or fetchFirstColumn() instead. */ public function fetchAll($fetchMode = null, $fetchArgument = null, $ctorArgs = null) { diff --git a/lib/Doctrine/DBAL/Driver/PDOStatement.php b/lib/Doctrine/DBAL/Driver/PDOStatement.php index 63d023e7eaf..8dfcd3b4475 100644 --- a/lib/Doctrine/DBAL/Driver/PDOStatement.php +++ b/lib/Doctrine/DBAL/Driver/PDOStatement.php @@ -156,7 +156,7 @@ public function fetch($fetchMode = null, $cursorOrientation = PDO::FETCH_ORI_NEX /** * {@inheritdoc} * - * @deprecated Use fetchAllNumeric(), fetchAllAssociative() or fetchColumn() instead. + * @deprecated Use fetchAllNumeric(), fetchAllAssociative() or fetchFirstColumn() instead. */ public function fetchAll($fetchMode = null, $fetchArgument = null, $ctorArgs = null) { diff --git a/lib/Doctrine/DBAL/Driver/ResultStatement.php b/lib/Doctrine/DBAL/Driver/ResultStatement.php index c48e0e28400..442552040cc 100644 --- a/lib/Doctrine/DBAL/Driver/ResultStatement.php +++ b/lib/Doctrine/DBAL/Driver/ResultStatement.php @@ -71,7 +71,7 @@ public function fetch($fetchMode = null, $cursorOrientation = PDO::FETCH_ORI_NEX /** * Returns an array containing all of the result set rows. * - * @deprecated Use fetchAllNumeric(), fetchAllAssociative() or fetchColumn() instead. + * @deprecated Use fetchAllNumeric(), fetchAllAssociative() or fetchFirstColumn() instead. * * @param int|null $fetchMode Controls how the next row will be returned to the caller. * The value must be one of the {@link \Doctrine\DBAL\FetchMode} constants, diff --git a/lib/Doctrine/DBAL/Driver/SQLAnywhere/SQLAnywhereStatement.php b/lib/Doctrine/DBAL/Driver/SQLAnywhere/SQLAnywhereStatement.php index d8282870281..bc4113fb9d5 100644 --- a/lib/Doctrine/DBAL/Driver/SQLAnywhere/SQLAnywhereStatement.php +++ b/lib/Doctrine/DBAL/Driver/SQLAnywhere/SQLAnywhereStatement.php @@ -258,7 +258,7 @@ public function fetch($fetchMode = null, $cursorOrientation = PDO::FETCH_ORI_NEX /** * {@inheritdoc} * - * @deprecated Use fetchAllNumeric(), fetchAllAssociative() or fetchColumn() instead. + * @deprecated Use fetchAllNumeric(), fetchAllAssociative() or fetchFirstColumn() instead. */ public function fetchAll($fetchMode = null, $fetchArgument = null, $ctorArgs = null) { diff --git a/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php b/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php index 3ac77d6446b..1bf4f6337bb 100644 --- a/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php +++ b/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php @@ -390,7 +390,7 @@ public function fetch($fetchMode = null, $cursorOrientation = PDO::FETCH_ORI_NEX /** * {@inheritdoc} * - * @deprecated Use fetchAllNumeric(), fetchAllAssociative() or fetchColumn() instead. + * @deprecated Use fetchAllNumeric(), fetchAllAssociative() or fetchFirstColumn() instead. */ public function fetchAll($fetchMode = null, $fetchArgument = null, $ctorArgs = null) { diff --git a/lib/Doctrine/DBAL/Portability/Statement.php b/lib/Doctrine/DBAL/Portability/Statement.php index 74f2574b47a..366b8288084 100644 --- a/lib/Doctrine/DBAL/Portability/Statement.php +++ b/lib/Doctrine/DBAL/Portability/Statement.php @@ -160,7 +160,7 @@ public function fetch($fetchMode = null, $cursorOrientation = PDO::FETCH_ORI_NEX /** * {@inheritdoc} * - * @deprecated Use fetchAllNumeric(), fetchAllAssociative() or fetchColumn() instead. + * @deprecated Use fetchAllNumeric(), fetchAllAssociative() or fetchFirstColumn() instead. */ public function fetchAll($fetchMode = null, $fetchArgument = null, $ctorArgs = null) { diff --git a/lib/Doctrine/DBAL/Statement.php b/lib/Doctrine/DBAL/Statement.php index 24a88123709..009558bfc93 100644 --- a/lib/Doctrine/DBAL/Statement.php +++ b/lib/Doctrine/DBAL/Statement.php @@ -263,7 +263,7 @@ public function fetch($fetchMode = null, $cursorOrientation = PDO::FETCH_ORI_NEX /** * {@inheritdoc} * - * @deprecated Use fetchAllNumeric(), fetchAllAssociative() or fetchColumn() instead. + * @deprecated Use fetchAllNumeric(), fetchAllAssociative() or fetchFirstColumn() instead. */ public function fetchAll($fetchMode = null, $fetchArgument = null, $ctorArgs = null) {