-
-
Notifications
You must be signed in to change notification settings - Fork 107
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
Row normalization #138
base: master
Are you sure you want to change the base?
Row normalization #138
Conversation
src/Database/Helpers.php
Outdated
for ($i=0; $i<$statement->columnCount(); $i++) { | ||
$meta = $statement->getColumnMeta($i); | ||
$tableName = isset($meta['table']) ? $meta['table'] : ''; | ||
if (isset($cols[$meta['name']])) { |
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.
IMHO $cols[$meta['name']][] = $tableName;
is always good, without if
For what cases it is necessary to have its own normalizer? And normalizer and own row factory? |
95ead5a
to
77e7871
Compare
77e7871
to
5ed5dfd
Compare
Sry for late response. So, at first this PR allow create your own row normalizer for whole session because you should specify it in config. Sometimes i need work with geomatics data types eg. point and it will be nice if i could wrap it in my own class globaly. According to #36 i added possibility to specify row normalizer for specific ResultSet, so you can for example turn off normalization if you need. RowFactory is used internally in Selection. It's because i want to use whole ResultSet with duplicate columns check feature... so i don't create at first Row instances and then ActiveRow from them but i used row factory so ResultSet::fetch return correct instances. I was also thinking about change ActiveRow to use Row instead of plain array, but i don't know. |
5c87d56
to
d9fd67a
Compare
@Unlink Thanks for all the PR. I'm sorry that I did not have time for Nette Database. I merged commit with improved error message on duplications. Now I'd like to release NDB 2.4, because it is the last unreleased package, and than I'll merge others PR like #102/#105, row normalizer, and we can discuss about refactoring Structure. Next NDB 2.5 can be released in few months. Ok? |
ok, thanks :) |
44a230d
to
829b936
Compare
b74e9fb
to
b2e321a
Compare
a329d1b
to
9f82d9d
Compare
Closes #36 and #100