@@ -12,7 +12,7 @@ using an email address that already exists in the system.
1212
1313.. versionadded :: 5.2
1414
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.
1616
1717========== ===================================================================
1818Applies to :ref: `class <validation-class-target >`
@@ -150,7 +150,7 @@ the current class instance. However, in some cases, such as when using Doctrine
150150inheritance mapping, you need to execute the query in a different repository.
151151Use this option to define the fully-qualified class name (FQCN) of the Doctrine
152152entity 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.
154154
155155errorPath
156156~~~~~~~~~
@@ -267,22 +267,27 @@ each with a single field.
267267
268268.. include :: /reference/constraints/_groups-option.rst.inc
269269
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.
270274
271275identifierFieldNames
272276~~~~~~~~~~~~~~~~~~~~
273277
274278**type **: ``array `` | ``string `` [:ref: `default option <validation-default-option >`]
275279
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.
277282This 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.
280285If set, it won’t trigger a uniqueness constraint violation when the only not unique
281286entity 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.
286291
287292Consider this example:
288293
0 commit comments