Skip to content

Commit

Permalink
Deprecated usage of Abstraction\Result as Driver\Result
Browse files Browse the repository at this point in the history
  • Loading branch information
morozov committed Sep 23, 2020
1 parent b9cb735 commit cf14c61
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 0 deletions.
5 changes: 5 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Upgrade to 2.11

## Deprecated the usage of Abstraction\Result as Driver\Result

The usage of the `Abstraction\Result` as a sub-type of the `Driver\Result` interface is deprecated.
The `Abstraction\Result` interface will not extend `Driver\Result` in DBAL 3.0.

## Deprecated the functionality of dropping client connections when dropping a database

The corresponding `getDisallowDatabaseConnectionsSQL()` and `getCloseActiveDatabaseConnectionsSQL` methods
Expand Down
78 changes: 78 additions & 0 deletions lib/Doctrine/DBAL/Abstraction/Result.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,60 @@
*/
interface Result extends DriverResult
{
/**
* Returns the next row of the result as a numeric array or FALSE if there are no more rows.
*
* @return array<int,mixed>|false
*
* @throws Exception
*/
public function fetchNumeric();

/**
* Returns the next row of the result as an associative array or FALSE if there are no more rows.
*
* @return array<string,mixed>|false
*
* @throws Exception
*/
public function fetchAssociative();

/**
* Returns the first value of the next row of the result or FALSE if there are no more rows.
*
* @return mixed|false
*
* @throws Exception
*/
public function fetchOne();

/**
* Returns an array containing all of the result rows represented as numeric arrays.
*
* @return array<int,array<int,mixed>>
*
* @throws Exception
*/
public function fetchAllNumeric(): array;

/**
* Returns an array containing all of the result rows represented as associative arrays.
*
* @return array<int,array<string,mixed>>
*
* @throws Exception
*/
public function fetchAllAssociative(): array;

/**
* Returns an array containing the values of the first column of the result.
*
* @return array<int,mixed>
*
* @throws Exception
*/
public function fetchFirstColumn(): array;

/**
* Returns an iterator over the result set rows represented as numeric arrays.
*
Expand All @@ -40,4 +94,28 @@ public function iterateAssociative(): Traversable;
* @throws Exception
*/
public function iterateColumn(): Traversable;

/**
* Returns the number of rows affected by the DELETE, INSERT, or UPDATE statement that produced the result.
*
* If the statement executed a SELECT query or a similar platform-specific SQL (e.g. DESCRIBE, SHOW, etc.),
* some database drivers may return the number of rows returned by that query. However, this behaviour
* is not guaranteed for all drivers and should not be relied on in portable applications.
*
* @return int The number of rows.
*/
public function rowCount();

/**
* Returns the number of columns in the result
*
* @return int The number of columns in the result. If the columns cannot be counted,
* this method must return 0.
*/
public function columnCount();

/**
* Discards the non-fetched portion of the result, enabling the originating statement to be executed again.
*/
public function free(): void;
}

0 comments on commit cf14c61

Please sign in to comment.