-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Following standards for method and variable naming. #115
Comments
Actually, it's correctly camelized: https://github.com/phalcon/cphalcon/blob/master/ext/phalcon.c#L491 Also, if you want to read the produced number of rows the method to call is rowCount http://docs.phalconphp.com/en/latest/api/Phalcon_Db_Result_Pdo.html |
@phalcon I've noticed it on documentation at: In example code, line: echo "There are ", $group->rowcount, " in ", $group->area; I have no idea where $group->rowcount comes from but I checked source code with my little internal API knowledge and found: https://github.com/phalcon/cphalcon/blob/master/ext/db/result/pdo.c#L258 And I have no idea if $group->rowcount is related with these API calls. |
ah ok, that's a column alias to easily access the COUNT(*) from the SQL statement SELECT area, COUNT(*) AS rowcount FROM x |
I hate to call it as "rowcount", is it possible to rename this alias as "rowCount"? |
the problem is that we're using pdo with PDO::CASE_LOWER, so even if I change that it will return it always in lowercase... |
Oh I see, using PDO lower case flag is probably related with PostgreSQL's field name handling problem if I remember right. |
hi, may I close this? |
@phalcon sure. |
I think it would be nice to use and follow "camelCase" standard for method and variable naming strictly.
About all Phalcon classes use camelCase standard (for method and variable naming) but I noticed Phalcon\Db\Result\Pdo and Phalcon\Db\Adapter\Pdo does not follow this standard strictly.
So "rowcount" property should be named as "rowCount".
The text was updated successfully, but these errors were encountered: