-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Normalize method signatures for fetch()
and fetchAll()
, ensuring compatibility with the PDOStatement
signature
#2527
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,29 +58,53 @@ public function setFetchMode($fetchMode, $arg2 = null, $arg3 = null); | |
/** | ||
* Returns the next row of a result set. | ||
* | ||
* @param integer|null $fetchMode Controls how the next row will be returned to the caller. | ||
* The value must be one of the PDO::FETCH_* constants, | ||
* defaulting to PDO::FETCH_BOTH. | ||
* @param int|null $fetchMode Controls how the next row will be returned to the caller. | ||
* The value must be one of the \PDO::FETCH_* constants, | ||
* defaulting to \PDO::FETCH_BOTH. | ||
* @param int $cursorOrientation For a ResultStatement object representing a scrollable cursor, | ||
* this value determines which row will be returned to the caller. | ||
* This value must be one of the \PDO::FETCH_ORI_* constants, | ||
* defaulting to \PDO::FETCH_ORI_NEXT. To request a scrollable | ||
* cursor for your ResultStatement object, you must set the \PDO::ATTR_CURSOR | ||
* attribute to \PDO::CURSOR_SCROLL when you prepare the SQL statement with | ||
* \PDO::prepare(). | ||
* @param int $cursorOffset For a ResultStatement object representing a scrollable cursor for which the | ||
* cursorOrientation parameter is set to \PDO::FETCH_ORI_ABS, this value | ||
* specifies the absolute number of the row in the result set that shall be | ||
* fetched. | ||
* For a ResultStatement object representing a scrollable cursor for which the | ||
* cursorOrientation parameter is set to \PDO::FETCH_ORI_REL, this value | ||
* specifies the row to fetch relative to the cursor position before | ||
* ResultStatement::fetch() was called. | ||
* | ||
* @return mixed The return value of this method on success depends on the fetch mode. In all cases, FALSE is | ||
* returned on failure. | ||
* | ||
* @see PDO::FETCH_* constants. | ||
*/ | ||
public function fetch($fetchMode = null); | ||
public function fetch($fetchMode = null, $cursorOrientation = \PDO::FETCH_ORI_NEXT, $cursorOffset = 0); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This signature change is a BC break and needs upgrade/migration path in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you @Ocramius, I've added a note in the upgrade path for 2.6 regarding these changes. |
||
|
||
/** | ||
* Returns an array containing all of the result set rows. | ||
* | ||
* @param integer|null $fetchMode Controls how the next row will be returned to the caller. | ||
* The value must be one of the PDO::FETCH_* constants, | ||
* defaulting to PDO::FETCH_BOTH. | ||
* @param int|null $fetchMode Controls how the next row will be returned to the caller. | ||
* The value must be one of the \PDO::FETCH_* constants, | ||
* defaulting to \PDO::FETCH_BOTH. | ||
* @param int|null $fetchArgument This argument has a different meaning depending on the value of the $fetchMode parameter: | ||
* * \PDO::FETCH_COLUMN: Returns the indicated 0-indexed column. | ||
* * \PDO::FETCH_CLASS: Returns instances of the specified class, mapping the columns of each | ||
* row to named properties in the class. | ||
* * \PDO::FETCH_FUNC: Returns the results of calling the specified function, using each row's | ||
* columns as parameters in the call. | ||
* @param array|null $ctorArgs Controls how the next row will be returned to the caller. | ||
* The value must be one of the \PDO::FETCH_* constants, | ||
* defaulting to \PDO::FETCH_BOTH. | ||
* | ||
* @return array | ||
* | ||
* @see PDO::FETCH_* constants. | ||
* @see \PDO::FETCH_* constants. | ||
*/ | ||
public function fetchAll($fetchMode = null); | ||
public function fetchAll($fetchMode = null, $fetchArgument = null, $ctorArgs = null); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This signature change is a BC break and needs upgrade/migration path in |
||
|
||
/** | ||
* Returns a single column from the next row of a result set or FALSE if there are no more rows. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It probably should've been
Doctrine\DBAL\Driver\ResultStatement::fetchAll($fetchMode, $fetchArgument, $ctorArgs);
.