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
initial commit of code changes to add ResultInterface::getNumRows method #4047
Conversation
…abase/ResultInterface and the various DBMS-specific Result classes. Also added unit test in the database/Live folder for this newly added method.
OK wow so the automated tests are failing like crazy, but the errors I see don't appear to relate to any files that I've changed. I'm quite new to pull requests and these automated tests. I do know that the one test I added does run without error on my workstation. @lonnieezell perhaps you could help me understand how to pass these tests? EDIT: something seems off as well about the extent of changes I've made. I think I might close this pull request and try to make a cleaner one. |
I'm going to close this PR and make a cleaner one. |
/** | ||
* Retrieve the results of the query. Typically an array of | ||
* individual data rows, which can be either an 'array', an | ||
* 'object', or a custom class name. | ||
* | ||
* @param string $type The row type. Either 'array', 'object', or a class name to use | ||
* | ||
* @return array | ||
* @return mixed |
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.
Why changed to mixed
?
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.
As I mentioned elsewhere, this first attempt at a PR had outdated files as its starting point. That is why I closed this request and tried again. Thank you for look at this PR, but I want you to know that I've closed it and it should be ignored. I'm sorry for wasting your time :(
* @param string $key | ||
* @param null $value | ||
* @param $key | ||
* @param null $value |
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.
string
is gone.
You changed |
@@ -58,47 +87,51 @@ public function getFieldNames(): array | |||
*/ | |||
public function getFieldData(): array | |||
{ | |||
static $dataTypes = [ | |||
static $data_types = [ |
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.
Why snake_case?
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.
I had mistakenly copied MySQLi/Result.php from a project I've been working on for a few weeks and I guess there were extensive edits to the comments (and this change of var name) in the interim. It became apparent after I submitted this PR that I needed to use more up-to-date files. That is why I closed this PR.
Also adds the implementation of this method to the various DBMS-specific Result classes. Also added unit test tests/system/database/Live/GetNumRowsTest for this newly added method.
Each pull request should address a single issue and have a meaningful title.
Description
Per Lonnie Ezell's message in #109, I have attempted my first CodeIgniter fork/branch/pull request here. It adds a getNumRows method to the ResultInterface and the various DBMS classes that extend it. I've not yet updated the user guide but will try to do so if this looks good.
Checklist: