Plugin, Tests, Overhaul, Many more features#7
Open
zeroasterisk wants to merge 9 commits intojamienay:masterfrom
Open
Plugin, Tests, Overhaul, Many more features#7zeroasterisk wants to merge 9 commits intojamienay:masterfrom
zeroasterisk wants to merge 9 commits intojamienay:masterfrom
Conversation
- [x] added unit testing for CopyableBehavior
- [x] switched to passing through the $record/$data vs keeping on Behavior
- [x] switched to passing through the $contain vs keeping on Behavior
- [x] switched to more dynamic settings - allows more recursion
onto Models which don't have this Behavior setup/configured
- [x] switched to "sticky" settings - when used via copy()
this takes priority over defaults, but not over per-Model settings
- [x] added support for custom settings for $contain (if set, does not generate)
- [x] added support for custom settings for $saveAllOptions
- [x] replaced old public generateContain() with copyGenerateContain()
renamed to match public method "psuedo-namespacing" - prefixed w/ "copy"
old alias retained for backwards compatibilty
- [x] exposed new public copyFindData() which does our lookup
- [x] exposed new public copyPrepareData() which does our convertion
- [x] exposed new public copySaveAll() which does our save
- [x] exposed new $Model->copyData array, for inspection of data before and after convertion
you can optionally inject data after prepare/convertion before save.
- [x] now we support data injection via merge or insert - [x] put in default, empty settings for ^ - [x] replaced `$data` with `$record` for consistancy
Author
fixed the tests for HABTM and nested hasMany
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I merged your project with my own implementation of something similar...
I decided that this was worthwhile, benefiting from the "best of both" implementations.
containandsaveAllOptionscopyPrepareDataCustom()method to custom-clean data if neededDetails
onto Models which don't have this Behavior setup/configured
this takes priority over defaults, but not over per-Model settings
renamed to match public method "psuedo-namespacing" - prefixed w/ "copy"
old alias retained for backwards compatibilty
$datawith$recordfor consistency