[Form] Moved logic of addXxx()/removeXxx() methods to the PropertyPath class#3819
Merged
fabpot merged 1 commit intosymfony:masterfrom Apr 10, 2012
Merged
[Form] Moved logic of addXxx()/removeXxx() methods to the PropertyPath class#3819fabpot merged 1 commit intosymfony:masterfrom
fabpot merged 1 commit intosymfony:masterfrom
Conversation
Contributor
Author
|
Again, the failing build is not my fault. |
Contributor
There was a problem hiding this comment.
This is never used in this file.
…h class Setting a property path like "article.tags" will now automatically try to favor addTag() and removeTag() over setTags(), if found. If you want to set up a property path with an irregular singular that is not detected, you can use "|" to separate the plural from the singular form in the path: "article.genera|genus". Another consequence of this commit is that the MergeCollectionListener has been simplified a lot. Forms returning an array or a collection will always result in adders/removers being called now without having to add this listener.
fabpot
added a commit
that referenced
this pull request
Apr 10, 2012
Commits ------- c4e68a3 [Form] Moved logic of addXxx()/removeXxx() methods to the PropertyPath class Discussion ---------- [Form] Moved logic of addXxx()/removeXxx() methods to the PropertyPath class Bug fix: yes Feature addition: no Backwards compatibility break: no Symfony2 tests pass: yes Fixes the following tickets: #3732 Todo: -  The addXxx()/removeXxx() methods should now be called correctly in ChoiceType and CollectionType. PropertyPath now favors addXxx()/removeXxx() over setXxx() for collections. For example: ``` $propertyPath = new PropertyPath('article.tags'); // Tries to use addTag()/removeTag() and only uses setTags() (et al.) // if not found $propertyPath->setValue($article, $tags); ``` For other languages than English or very irregular plurals, a custom singular can be set by separating it with a pipe: ``` $propertyPath = new PropertyPath('article.genera|genus'); ``` --------------------------------------------------------------------------- by bschussek at 2012-04-07T12:40:39Z Again, the failing build is not my fault.
Contributor
|
As mentioned by @stof the functionality has been reverted and it is currently not possible to use another name than guessed by symfony. |
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.
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #3732
Todo: -
The addXxx()/removeXxx() methods should now be called correctly in ChoiceType and CollectionType.
PropertyPath now favors addXxx()/removeXxx() over setXxx() for collections. For example:
For other languages than English or very irregular plurals, a custom singular can be set by separating it with a pipe: