-
Notifications
You must be signed in to change notification settings - Fork 370
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
rowCount #84
Comments
Can you give me a use case for this feature? |
Yes, I know it's a raw_query use but....
I think this could be more useful with delete() and delete_many(). |
As a workaround, consider Unfortunately, |
@featureless @tag has beaten me to it. I was going to suggest that you drop down to the PDO object directly for this. I wanted a use case though to ensure that it was an appropriate suggestion :) |
@tag thanks for the idea, but unfortunately it did not work, get_db() return a PDO object not PDOStatement. |
Of course. Good catch. Re-opening. Any one want to work on a patch for this? |
for reasons of portability, I could understand that it isn't implemented, another solution could be to have access to PDOStatement in idiorm, so it would be possible to have rowCount and also columnCount, debugDumpParams, errorCode, errorInfo |
@featureless sounds like a good idea, but I am not sure how it would be possible. Want to submit a pull request? |
I think a simple solution could be to add a new property and function like that:
After replacing code like
By:
For example _run could be:
|
This could work out OK. I do not have the time to complete this change though so it would be great if someone could pick it up and submit a full pull request. |
I can play with it. I'll make sure it works with Given these other concerns, it might be more straightforward to not abstract out Is there agreement on at least |
Thanks for looking into this. Yes, those two namings sound good. |
See pull request. Ended up following @featureless's concept very closely, although I used I neglected to add a test. Maybe when I get home tonight. |
Hi tag, good job! thanks. |
HI,
Why not use PDOStatement :: rowCount to get the number of rows affected by the last statement.
This property could be populated in the _run function after the statement execution like this:
$this->_rowCount = $statement->rowCount();
Regards,
The text was updated successfully, but these errors were encountered: