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
Extended PDO #59
Comments
|
It took me a while to understand what you were getting at. I think I understand now. Having the fetchAll() (and perhaps other methods) take yet another (4th) argument makes me think we are trying to shove too much functionality into the individual methods. I don't want to find out later that we need a 5th, 6th, etc set of arguments. One option is to make the 3rd param a generic specification, and the 4th param the target of the specification, just as with PDO now. For example, the existing functionality would be this (note the new FETCH_CLOSURE constant): And the functionality you are asking for would be this: That might increase the complexity of the various fetch methods, but I'm not opposed to doing so if needed. Your thoughts? |
|
@pmjones my question can't we set a method to set the fetch method. So the fetchAll will not use But something like |
|
and your example is also a good one. |
|
You are confusing $sth (which is a PDOStatement object) with $pdo (which is a PDO or ExtendedPDO object). Be careful not to mix up your expectations of each one. |
|
I thought we could have placed a |
|
Let's not over-complicate things. If people want fine control over how things work, they can continue to work with PDOStatement objects as they have in the past. The point here is not to anticipate every possible need, but to make common cases easy. |
|
ok :) . Hari K T http://harikt.com , https://github.com/auraphp On Mon, Oct 7, 2013 at 1:54 PM, Paul M. Jones notifications@github.comwrote:
|
|
Hey now, the other part (about modifying fetchAll() to use the underlying FETCH_* modes and params) might still be useful. I'm reopening so I can keep it on my mind a little more. :-) |
|
After working this over a couple different ways, I'm going to leave the method signature the way it is. Thanks for the suggestion, and your patience. |
|
@pmjones you have all the rights to open and close :) |
|
@pmjones can we close this for you have implemented it. |
|
Ah so! Thanks for the reminder. |
Hi Paul,
I was looking into the
fetchAllmethod of the extended PDO and the fetchAll method of the normal PDO.http://www.php.net/manual/en/pdostatement.fetchall.php
You can see in
ExtendedPdothey will not get a chance to make the class bind to the return values. Will it be good, if we can make optional arguments as that offetchAllmethod signature ?http://php.net/manual/en/pdostatement.setfetchmode.php
This is with respect to my recent experiment on fetchMode.
Let me know your thoughts.
The text was updated successfully, but these errors were encountered: