Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Clarified Default and ClassName groups#3593

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

Merged
weaverryan merged 2 commits intosymfony:2.3fromwouterj:improve_default_group
Mar 8, 2014

Conversation

wouterj
Copy link
Member

This is still the most difficult part of the validation groups and we
don't put much attention on it. I've refactored it a bit after the
really great explaination of@webmozart.

For more information see:symfony/symfony#10287 (comment)

QA
Doc fix?yes
New docs?yes
Applies toall
Fixed tickets-

@wouterj
Copy link
MemberAuthor

btw, also fixed some grammar in the Group Sequence Provider section

@lyrixx
Copy link
Member

Thank you very much for that.

and is considered the ``Default`` group. (This group is useful for
* ``User`` - contains the constraints that belong to no other group;

* ``Default`` - equivalent to the ``User`` group (This group is useful for
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

IMO this is the wrong order. All constraints belong to the "Default" group first and foremost. "User" is just an alias for the constraints in the "Default" group of theUser class. That means, for example:

class Userextends Person{/**     * @Assert\Valid     * @Assert\Type("Acme\Address")     */private$address;}
  • When I validate aUser object in the "Default" group, all default constraints of both theUser and theAddress will be validated.
  • When I validate it in the "User" group, only the default constraints of theUser class (and superclasses) will be executed
  • When I validate it in the "Address" group, only the default constraints of theAddress class will be executed.
  • When I validated it in the "Person" group, only the default constraints of thePerson class (and superclasses) will be executed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Btw, you should use CamelCaps notation for group names.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

About your first comment: Thanks a lot for creating such a nice real world examples! :) It helps me a lot to understand the topic. I think I've covered it now in the updated list.

And your second comment: I can't see a place where I don't use CamelCaps?

@webmozart
Copy link
Contributor

Thanks for clarifying@wouterj!

@weaverryan
Copy link
Member

This ismuch better explained! Though I'll admit, the subtleties between the Default and User stuff makes my head spin a little bit still.

weaverryan added a commit that referenced this pull requestMar 8, 2014
This PR was merged into the 2.3 branch.Discussion----------Clarified Default and ClassName groupsThis is still the most difficult part of the validation groups and wedon't put much attention on it. I've refactored it a bit after thereally great explaination of@webmozart.For more information see:symfony/symfony#10287 (comment)| Q   | A| --- | ---| Doc fix? | yes| New docs? | yes| Applies to | all| Fixed tickets | -Commits-------b6357fa Updated after review of@webmozart2330cd8 Clarified Default vs ClassName groups
@weaverryanweaverryan merged commitb6357fa intosymfony:2.3Mar 8, 2014
@wouterjwouterj deleted the improve_default_group branchMarch 8, 2014 18:35
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@wouterj@lyrixx@webmozart@weaverryan

[8]ページ先頭

©2009-2025 Movatter.jp