Skip to content

Commit 5d000de

Browse files
authored
Update UniqueEntity.rst
1 parent a2765d3 commit 5d000de

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

reference/constraints/UniqueEntity.rst

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,14 +268,20 @@ each with a single field.
268268

269269

270270
identifierFieldNames
271-
~~~~~~~~~~
271+
~~~~~~~~~~~~~~~~~~~~
272272

273273
**type**: ``array`` | ``string`` [:ref:`default option <validation-default-option>`]
274274

275-
This optional option is the field (or list of fields) of identifier field names
276-
that are defined in the entity set by the `entityClass`_ option.
275+
Use it only when the validated object is not an entity and you need to update an entity.
276+
This option is the identifier field name that is the ``primary key`` or the identifier
277+
field names that are ``composite keys`` in the entity set by the `entityClass`_ option.
277278

278-
Use it only when the checked object is not an entity and you need to update an entity.
279+
If set, it won’t trigger a uniqueness constraint violation when the only not unique
280+
entity identifier(s) value(s) will be matching corresponding value(s) from the
281+
validated object.
282+
If validated object field names do not match the ones from the entity,
283+
use key-value mapping; Where ``key`` is the name of the field in the validated object
284+
and ``value`` is the name of the field in the entity.
279285

280286
.. versionadded:: 5.2
281287

0 commit comments

Comments
 (0)