-
-
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
Refactored Model, added Loader::isRegistered, fixed Metadata behaviour #16392
Conversation
@rudiservo Can you split that into much smaller PRs please? Say one for the loader, one for the messages changed/exceptions, one for metadata etc. There are a lot of areas that I do not understand what the goal of the changes are, for instance the keys for metadata are no longer held in lowercase. |
@niden sure, I did tried to make seperate pull requests, github just put it into one dont know why. Metadata changes are on their own commit. Metadata keys are in lowercase, using get_class_lower(), what they are is no longer concat with the schema and source in case of the actual MetaData, ColumnMap was always lowercase but it used two functions, get_class() and strtolower(). Schema and source are pulled from the manager, and the manager associates them with the get_class_lower() only, makes no sense to make a metadata key with all that when the information is only associated with the full namespace class itself. In the Model Messages the changes are for better error reporting, many times I do not know where the error is and I have to do a game of var_dump() die() or figuring out where in xdebug trace it failed. The postSaveRelatedRecords is to seperate the logic through from normal, it makes code analysis simpler has well has less checks, maybe slight performance improvement. |
And metadata::initialize was overblown with code that was not supposed to be there and the calls to it actually should only call initializeMetadata or InitializeColumnMap, now it's cleaner, probably very very very very very small performance improvement. |
1192ed1
to
6c6eba3
Compare
Hello!
In raising this pull request, I confirm the following:
Small description of change:
Refactored the Model::doLowUpdate for better seperation of dynamicUpdate from normal full update.
Added better error reporting adding the class on which it happened.
Added Model::appendMessagesFrom for code quality and added the model name to the message MetaData
Added Model and relatedName to Message MetaData in several lines where there was no reference to model and/or relation where the non-exception failure occurred.
Thanks