-
-
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
Mvc\Model::__get() / __set() and related storage #14035
Mvc\Model::__get() / __set() and related storage #14035
Conversation
Added tests for Mvc\Model::save() Added tests for Mvc\Model::__set() Added tests for Mvc\Model::writeAttribute()
Added new related storages Modified __set(), __get(), getRelated() to use these related storages Modified save() to use these related storages with transaction handling Modified _getRelatedRecords() to use getRelated() when possible Reusable relations now cached and returned from the Model directly Non-reusable relation are not cached Fixed __set() to handle arrays correctly
Codecov Report
@@ Coverage Diff @@
## 4.0.x #14035 +/- ##
==========================================
- Coverage 70.55% 68.84% -1.72%
==========================================
Files 479 470 -9
Lines 93433 95198 +1765
==========================================
- Hits 65924 65539 -385
- Misses 27509 29659 +2150
Continue to review full report at Codecov.
|
/cc @phalcon/framework-team |
Added missing comments
* Added variable types. * Whitespace. * Improved logic.
…n#14026) * Fixeing Config\Adapter\Ini notices when casting arrays * Fixed Phalcon\Config\Adapter\Ini() to handle arrays correctly * Update tests/_data/assets/config/config-with-constants.ini Co-Authored-By: zsilbi <[email protected]> * Fixeing Config\Adapter\Ini notices when casting arrays * Fixed Phalcon\Config\Adapter\Ini() to handle arrays correctly
Added tests for Mvc\Model::save() Added tests for Mvc\Model::__set() Added tests for Mvc\Model::writeAttribute()
@CameronHall I checked SplObjectStorage but I dont't think it would be beneficial to use here. |
@zsilbi can you please rebase this? This looks great. Awesome work! |
35c5299
to
d90459b
Compare
Thank you @zsilbi |
Hello!
In raising this pull request, I confirm the following:
Added new related storages
Modified __set(), __get(), getRelated() to use these related storages
Modified save() to use these related storages with transaction handling
Modified _getRelatedRecords() to use getRelated() when possible
Reusable relations are cached and returned from the Model directly
Non-reusable relations are not cached
Fixed __set() to handle arrays correctly
Added tests for Mvc\Model::save()
Added tests for Mvc\Model::__set()
Added tests for Mvc\Model::writeAttribute()
More tests needed...
Thanks,
zsilbi