Skip to content
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

Merged
merged 53 commits into from May 11, 2019

Conversation

Projects
7 participants
@zsilbi
Copy link
Contributor

commented May 2, 2019

Hello!

In raising this pull request, I confirm the following:

  • I have read and understood the Contributing Guidelines
  • I have checked that another pull request for this purpose does not exist
  • I wrote some tests for this PR
  • I updated the CHANGELOG

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

zsilbi and others added some commits Apr 16, 2019

Németh Balázs
Added tests for Mvc\Model::isRelationShipLoaded()
Added tests for Mvc\Model::save()
Added tests for Mvc\Model::__set()
Added tests for Mvc\Model::writeAttribute()
Németh Balázs
Removed storing related records in class properties
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
Németh Balázs
@codecov

This comment has been minimized.

Copy link

commented May 3, 2019

Codecov Report

Merging #14035 into 4.0.x will decrease coverage by 1.71%.
The diff coverage is n/a.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
ext/phalcon/mvc/model/metadata/apcu.zep.c 8.33% <0%> (-87.23%) ⬇️
ext/phalcon/filter/sanitize/specialfull.zep.c 23.07% <0%> (-76.93%) ⬇️
ext/phalcon/1__closure.zep.c 25% <0%> (-56.82%) ⬇️
ext/phalcon/12__closure.zep.c 25% <0%> (-56.82%) ⬇️
ext/phalcon/11__closure.zep.c 25% <0%> (-56.82%) ⬇️
ext/phalcon/13__closure.zep.c 25% <0%> (-56.82%) ⬇️
ext/phalcon/8__closure.zep.c 37.5% <0%> (-44.32%) ⬇️
ext/phalcon/3__closure.zep.c 37.5% <0%> (-44.32%) ⬇️
ext/phalcon/15__closure.zep.c 37.5% <0%> (-44.32%) ⬇️
ext/phalcon/4__closure.zep.c 37.5% <0%> (-44.32%) ⬇️
... and 122 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 55a7139...d90459b. Read the comment docs.

@sergeyklay

This comment has been minimized.

Copy link
Member

commented May 4, 2019

ruudboon and others added some commits Apr 26, 2019

Update libmemcached.zep
Added missing comments
[WIP] Added variable types. (#14015)
* Added variable types.

* Whitespace.

* Improved logic.
Fixed Phalcon\Config\Adapter\Ini() to handle arrays correctly (#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 <zsilbi@users.noreply.github.com>

* Fixeing Config\Adapter\Ini notices when casting arrays

* Fixed Phalcon\Config\Adapter\Ini() to handle arrays correctly
Németh Balázs
Added tests for Mvc\Model::isRelationShipLoaded()
Added tests for Mvc\Model::save()
Added tests for Mvc\Model::__set()
Added tests for Mvc\Model::writeAttribute()
@zsilbi

This comment has been minimized.

Copy link
Contributor Author

commented May 7, 2019

@CameronHall I checked SplObjectStorage but I dont't think it would be beneficial to use here.
The related records are indexed by their aliases, not by their content (hash).
On the other hand, I think in Manager, if you have to store any data for a given object, it could work.

@zsilbi zsilbi changed the title [WIP] Mvc\Model::__get() / __set() and related storage Mvc\Model::__get() / __set() and related storage May 7, 2019

Németh Balázs
@niden

This comment has been minimized.

Copy link
Member

commented May 10, 2019

@zsilbi can you please rebase this?

This looks great. Awesome work!

@zsilbi zsilbi force-pushed the zsilbi:model-relation-storage-with-tests branch from 35c5299 to d90459b May 11, 2019

@niden niden merged commit d90459b into phalcon:4.0.x May 11, 2019

1 of 4 checks passed

codecov/project 68.84% (-1.72%) compared to 55a7139
Details
continuous-integration/appveyor/pr AppVeyor was unable to build non-mergeable pull request
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
codecov/patch Coverage not affected when comparing 55a7139...d90459b
Details
@niden

This comment has been minimized.

Copy link
Member

commented May 11, 2019

Thank you @zsilbi

@niden niden added this to In progress in 4.0 Release via automation May 11, 2019

@niden niden moved this from In progress to Done in 4.0 Release May 11, 2019

@niden niden added the Docs needed label May 12, 2019

@zsilbi zsilbi deleted the zsilbi:model-relation-storage-with-tests branch May 13, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.