Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add identifierFieldNames option details to Update UniqueEntity.rst#21456

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
toby-griffiths wants to merge2 commits intosymfony:7.3fromtoby-griffiths:patch-4
Closed
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletionsreference/constraints/UniqueEntity.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -272,6 +272,28 @@ If you need to require two fields to be individually unique (e.g. a unique
``email`` and a unique ``username``), you use two ``UniqueEntity`` entries,
each with a single field.

``identifierFieldNames``
~~~~~~~~~~~~~~~~~~~~~~~~

**type**: ``array``

When applying the constraint to a non-entity class, this allows you to specify
which field(s), on the object being validated, should be used to determine
whether the object being validated is the same as an existing entity found
with matching field value(s).

If the value(s) found in the object being validated's ``identifierFieldNames``
fields match the itentifiers of the object found in the databased, then that
match is permitted. If the identifiers to not match, then the found record
will cause the valudation to fail.

.. warning::

The array of values given should be the same as the identifier fields on
the entity class, otherwise a
``\Symfony\Component\Validator\Exception\ConstraintDefinitionException``
will be thrown during validation.

.. include:: /reference/constraints/_groups-option.rst.inc

``ignoreNull``
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp