@@ -33,30 +33,30 @@ Basic Usage
33
33
34
34
.. code-block :: php-annotations
35
35
36
- // src/Acme/BlogBundle/Entity/Author.php
37
- namespace Acme\BlogBundle\Entity;
38
-
39
- use Symfony\Component\Validator\Constraints as Assert;
40
-
41
- class Author
42
- {
43
- /**
44
- * @Assert\Type(type="integer", message="The value {{ value }} is not a valid {{ type }}.")
45
- */
36
+ // src/Acme/BlogBundle/Entity/Author.php
37
+ namespace Acme\BlogBundle\Entity;
38
+
39
+ use Symfony\Component\Validator\Constraints as Assert;
40
+
41
+ class Author
42
+ {
43
+ /**
44
+ * @Assert\Type(type="integer", message="The value {{ value }} is not a valid {{ type }}.")
45
+ */
46
46
protected $age;
47
- }
47
+ }
48
48
49
49
.. code-block :: xml
50
50
51
- <!-- src/Acme/BlogBundle/Resources/config/validation.xml -->
52
- <class name =" Acme\BlogBundle\Entity\Author" >
53
- <property name =" age" >
54
- <constraint name =" Type" >
55
- <option name =" type" >integer</option >
56
- <option name =" message" >The value {{ value }} is not a valid {{ type }}.</option >
57
- </constraint >
58
- </property >
59
- </class >
51
+ <!-- src/Acme/BlogBundle/Resources/config/validation.xml -->
52
+ <class name =" Acme\BlogBundle\Entity\Author" >
53
+ <property name =" age" >
54
+ <constraint name =" Type" >
55
+ <option name =" type" >integer</option >
56
+ <option name =" message" >The value {{ value }} is not a valid {{ type }}.</option >
57
+ </constraint >
58
+ </property >
59
+ </class >
60
60
61
61
Options
62
62
-------
71
71
This required option is the fully qualified class name or one of the PHP datatypes
72
72
as determined by PHP's ``is_ `` functions.
73
73
74
- * `array <http://php.net/is_array >`_
75
- * `bool <http://php.net/is_bool >`_
76
- * `callable <http://php.net/is_callable >`_
77
- * `float <http://php.net/is_float >`_
78
- * `double <http://php.net/is_double >`_
79
- * `int <http://php.net/is_int >`_
80
- * `integer <http://php.net/is_integer >`_
81
- * `long <http://php.net/is_long >`_
82
- * `null <http://php.net/is_null >`_
83
- * `numeric <http://php.net/is_numeric >`_
84
- * `object <http://php.net/is_object >`_
85
- * `real <http://php.net/is_real >`_
86
- * `resource <http://php.net/is_resource >`_
87
- * `scalar <http://php.net/is_scalar >`_
88
- * `string <http://php.net/is_string >`_
89
-
74
+ * `array <http://php.net/is_array >`_
75
+ * `bool <http://php.net/is_bool >`_
76
+ * `callable <http://php.net/is_callable >`_
77
+ * `float <http://php.net/is_float >`_
78
+ * `double <http://php.net/is_double >`_
79
+ * `int <http://php.net/is_int >`_
80
+ * `integer <http://php.net/is_integer >`_
81
+ * `long <http://php.net/is_long >`_
82
+ * `null <http://php.net/is_null >`_
83
+ * `numeric <http://php.net/is_numeric >`_
84
+ * `object <http://php.net/is_object >`_
85
+ * `real <http://php.net/is_real >`_
86
+ * `resource <http://php.net/is_resource >`_
87
+ * `scalar <http://php.net/is_scalar >`_
88
+ * `string <http://php.net/is_string >`_
89
+
90
90
message
91
91
~~~~~~~
92
92
93
93
**type **: ``string `` **default **: ``This value should be of type {{ type }} ``
94
94
95
- The message if the underlying data is not of the given type.
95
+ The message if the underlying data is not of the given type.
0 commit comments