@@ -6,7 +6,9 @@ Countable) element count is *between* some minimum and maximum value.
6
6
7
7
========== ===================================================================
8
8
Applies to :ref: `property or method <validation-property-target >`
9
- Options - `exactMessage `_
9
+ Options - `divisibleBy `_
10
+ - `divisibleByMessage `_
11
+ - `exactMessage `_
10
12
- `groups `_
11
13
- `max `_
12
14
- `maxMessage `_
@@ -101,6 +103,44 @@ you might add the following:
101
103
Options
102
104
-------
103
105
106
+ divisibleBy
107
+ ~~~~~~~~~~~
108
+
109
+ **type **: ``integer `` **default **: null
110
+
111
+ .. versionadded :: 5.1
112
+
113
+ The ``divisibleBy `` option was introduced in Symfony 5.1.
114
+
115
+ Validates that the number of elements of the given collection is divisible by
116
+ a certain number.
117
+
118
+ .. seealso ::
119
+
120
+ If you need to validate that other types of data different from collections
121
+ are divisible by a certain number, use the
122
+ :doc: `DivisibleBy </reference/constraints/DivisibleBy >` constraint.
123
+
124
+ divisibleByMessage
125
+ ~~~~~~~~~~~~~~~~~~
126
+
127
+ **type **: ``string `` **default **: ``The number of elements in this collection should be a multiple of {{ compared_value }}. ``
128
+
129
+ .. versionadded :: 5.1
130
+
131
+ The ``divisibleByMessage `` option was introduced in Symfony 5.1.
132
+
133
+ The message that will be shown if the number of elements of the given collection
134
+ is not divisible by the number defined in the ``divisibleBy `` option.
135
+
136
+ You can use the following parameters in this message:
137
+
138
+ ======================== ===================================================
139
+ Parameter Description
140
+ ======================== ===================================================
141
+ ``{{ compared_value }} `` The number configured in the ``divisibleBy `` option
142
+ ======================== ===================================================
143
+
104
144
exactMessage
105
145
~~~~~~~~~~~~
106
146
0 commit comments