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

Commitbfe3a20

Browse files
committed
[Validation] Add "hasser" support
1 parentb1e0886 commitbfe3a20

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

‎book/validation.rst‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -583,8 +583,8 @@ Getters
583583

584584
Constraints can also be applied to the return value of a method. Symfony2
585585
allows you to add a constraint to any public method whose name starts with
586-
"get"or "is". In this guide,both ofthese types of methods are referred
587-
toas "getters".
586+
"get", "is"or "has". In this guide, these types of methods are referred to
587+
as "getters".
588588

589589
The benefit of this technique is that it allows you to validate your object
590590
dynamically. For example, suppose you want to make sure that a password field
@@ -665,9 +665,9 @@ Now, create the ``isPasswordLegal()`` method, and include the logic you need::
665665
..note::
666666

667667
The keen-eyed among you will have noticed that the prefix of the getter
668-
("get"or "is") is omitted in the mapping. This allows you to move the
669-
constraint to a property with the same name later (or vice versa) without
670-
changing your validation logic.
668+
("get", "is"or "has") is omitted in the mapping. This allows you to move
669+
theconstraint to a property with the same name later (or vice versa)
670+
withoutchanging your validation logic.
671671

672672
.. _validation-class-target:
673673

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp