@@ -12,7 +12,7 @@ using an email address that already exists in the system.
12
12
13
13
.. versionadded :: 5.2
14
14
15
- Not entity (like DTO) field (or fields) validation against entities persisted in the database, was introduced in Symfony 5.2.
15
+ Any class instance (like DTO) field (or fields) validation against entities persisted in the database was introduced in Symfony 5.2.
16
16
17
17
========== ===================================================================
18
18
Applies to :ref: `class <validation-class-target >`
@@ -150,7 +150,7 @@ the current class instance. However, in some cases, such as when using Doctrine
150
150
inheritance mapping, you need to execute the query in a different repository.
151
151
Use this option to define the fully-qualified class name (FQCN) of the Doctrine
152
152
entity associated with the repository you want to use.
153
- Another case is when the validated object is not an entity.
153
+ Another case is when the object being validated is not an entity.
154
154
155
155
errorPath
156
156
~~~~~~~~~
@@ -267,22 +267,27 @@ each with a single field.
267
267
268
268
.. include :: /reference/constraints/_groups-option.rst.inc
269
269
270
+ If object being validated field name(s) do not match the ones from the entity,
271
+ use key-value mapping; Where ``key `` is the name of the field in the object being
272
+ validated and ``value `` is the name of the field in the entity.
273
+ Field name(s) mapping only applies when the object being validated is not an entity.
270
274
271
275
identifierFieldNames
272
276
~~~~~~~~~~~~~~~~~~~~
273
277
274
278
**type **: ``array `` | ``string `` [:ref: `default option <validation-default-option >`]
275
279
276
- Use it only when the validated object is not an entity and you need to update an entity.
280
+ Use it only when the object being validated is not an entity and you need to update an
281
+ entity with it.
277
282
This option is the identifier field name that is the ``primary key `` or the identifier
278
- field names that are ``composite keys `` in the entity set by the `entityClass `_ option.
279
-
283
+ field names that are ``composite keys `` in the entity class set by the `entityClass `_
284
+ option.
280
285
If set, it won’t trigger a uniqueness constraint violation when the only not unique
281
286
entity identifier(s) value(s) will be matching corresponding value(s) from the
282
- validated object.
283
- If validated object field names do not match the ones from the entity,
284
- use key-value mapping; Where ``key `` is the name of the field in the validated object
285
- and ``value `` is the name of the field in the entity.
287
+ object being validated .
288
+ If object being validated field name(s) do not match the ones from the entity,
289
+ use key-value mapping; Where ``key `` is the name of the field in the object being
290
+ validated and ``value `` is the name of the field in the entity.
286
291
287
292
Consider this example:
288
293
0 commit comments