Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.3k
Validator Documentation for Collection constraint Required/Optional options#2432
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Validator Documentation for Collection constraint Required/Optional options#2432
Uh oh!
There was an error while loading.Please reload this page.
Conversation
and Optional classes.
reference/constraints/Collection.rst Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
the heading line should be as long as the heading title
benglass commentedMar 30, 2013
Note: YML and XML examples for configuration are not included. Worked with weaverryan to try to come up with a working version in YML without success. This gist contains the YML configuration I tried: The issue was that the constraint for the field needed to be parsed into an instance of Required or Optional and instead it was always parsed into an array with a single instance of Required or Optional in it. Might be a YML limitation or just something wrong with the syntax I tried. |
reference/constraints/Collection.rst Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
some line breaking missing.
benglass commentedMar 30, 2013
Fixed whitespace issues from your comments. |
reference/constraints/Collection.rst Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I prefer to have the 2= lined up with eachother.
Formatting changes per comments from@wouterj
Change 'example' to 'instance'.
reference/constraints/Collection.rst Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
completely from the ``profileData`` array [...]Add variable indicators around profileData
Removed use statements for Required/Optional. Instead use Assert\Collection\Required.
stof commentedApr 4, 2013
you should add the YAML and XML mapping too |
wouterj commentedApr 4, 2013
@stof it seems like this is not possible with Yaml and Xml. Afishnamedsquish, Ryan and I have tried it but can't come with a solution. Even bernhard didn't know the format, see also:https://gist.github.com/afishnamedsquish/5277987 |
stof commentedApr 5, 2013
@wouterj This should be reported as a bug if YAML and XML don't support it. Can you open a ticket ? |
wouterj commentedApr 6, 2013
@stof, yes I will do |
…optional_required_docsValidator Documentation for Collection constraint Required/Optional options
weaverryan commentedApr 9, 2013
Hey! This is a really nice entry - very clearly explained, nice work! I did tweak some minor language at sha:cf049ed, because iirc, Thanks! |
xabbuh commentedMay 1, 2013
This works for me: Acme\AuthorBundle\Entity\Author:properties:profileData: -Collection:fields:alternate_email:constraints: -Collection\Optional: -Email:~ Can someone confirm? |
wouterj commentedMay 1, 2013
negative for sf2.1 (didn't test it in other versions) |
This PR was submitted for the 2.1 branch but it was merged into the 2.2 branch instead (closes#7930).Discussion----------handle Optional and Required constraints from XML or YAML sources correc......tly| Q | A| ------------- | ---| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |#7575| License | MIT| Doc PR |symfony/symfony-docs#2432Commits-------a93a23a handle Optional and Required constraints from XML or YAML sources correctly
xabbuh commentedJul 21, 2013
Now thatsymfony/symfony#7930 is merged. Is any work left here? |
benglass commentedJul 22, 2013
An example of YML configuration could be added to the docs |
wouterj commentedJul 22, 2013
And a xml example |
xabbuh commentedJul 22, 2013
You're right, see#2841 for this. |
#999