-
-
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
Conversation
Please PR against master. Backporting is up to us. On 1 Oct 2016 15:42, "Javier Spagnoletti" notifications@github.com wrote:
|
fetch()
and fetchAll()
fetch()
and fetchAll()
@phansys What about the usage of func_get_args ? |
@phansys yes please do as @mikeSimonson suggested. We already follow this approach here |
@mikeSimonson, @deeky666; the reason for the comment in my TODO is that I'm trying to normalize the method signatures, making them as explicitly as possible. Using |
@phansys If it's possible to make the signature more explicit in those cases go for it. |
b778a43
to
93b3848
Compare
fetch()
and fetchAll()
fetch()
and fetchAll()
The BC is respected internally, since |
Which is the status of this PR? Ping @Ocramius, @deeky666, @mikeSimonson. |
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.
@phansys excellent work, but we need to document the migration approach for existing implementations in UPGRADE.md
* | ||
* @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 comment
The 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 UPGRADE.md
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.
Thank you @Ocramius, I've added a note in the upgrade path for 2.6 regarding these changes.
*/ | ||
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 comment
The 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 UPGRADE.md
Thanks @phansys! |
fetch()
and fetchAll()
fetch()
and fetchAll()
, ensuring compatibility with the PDOStatement
signature
|
||
After: | ||
|
||
Doctrine\DBAL\Driver\ResultStatement::fetch($fetchMode, $fetchArgument, $ctorArgs); |
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);
.
As part of #2953 would be best, since it already deals with moving away from PDO |
Apparently, some drivers like IBM DB2, SQLServer and others implement handling additional arguments in Instead, we can change their signatures to |
TODO
func_get_args()
atDB2Statement
,SQLAnywhereStatement
andSQLSrvStatement
.Close #2519.