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

[Validator] Improve documentation forUniqueEntity constraint#21197

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

Open
ker0x wants to merge3 commits intosymfony:7.3
base:7.3
Choose a base branch
Loading
fromker0x:fix/unique-entity

Conversation

@ker0x
Copy link
Contributor

Replace#14458 and#20166

I'm targeting7.3 because i don't know if changes made in7.1 are transferred to 7.3. Otherwise, let me know and I'll change it.

@ker0xker0x requested a review fromxabbuh as acode ownerJuly 9, 2025 12:19
@carsonbotcarsonbot changed the title[DoctrineBridge][Validator] Improve documentation for UniqueEntity constraint[Validator] Improve documentation for UniqueEntity constraintJul 9, 2025
@ker0xker0xforce-pushed thefix/unique-entity branch 2 times, most recently from604f8fe tob1a3e1aCompareJuly 9, 2025 12:24
@OskarStarkOskarStark changed the title[Validator] Improve documentation for UniqueEntity constraint[Validator] Improve documentation forUniqueEntity constraintJul 9, 2025
@wkania
Copy link
Contributor

Nice. Looking at my pull request, I think it would also be helpful to mention which version of Symfony introduced this feature.

.. versionadded:: 7.1    Any class instance (like DTO) field (or fields) validation against entities persisted in the database was introduced in Symfony 7.1... versionadded:: 7.1    The option was introduced in Symfony 7.1.

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

**type**: ``array`` **default**: ``[]``
Copy link
Contributor

@wkaniawkaniaAug 1, 2025
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

The type should be**type**: ``array`` | ``string`` [:ref:`default option <validation-default-option>`]
It accept string when not combined identifier. Like:
identifierFieldNames: 'id'

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I don't think so because the property is typed with?array in the UniqueEntity class:https://github.com/symfony/doctrine-bridge/blob/7.3/Validator/Constraints/UniqueEntity.php#L60

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Now, I see that in the end I didn't do it likefields argument.

@ker0x
Copy link
ContributorAuthor

@xabbuh@javiereguiluz could it be possible to review this PR please?

@toby-griffiths
Copy link
Contributor

I've just found this hidden option and wanted to share, but then realised that this PR already existed to add this.

Can I help get this over the line? It looks like the checks are failing because a code block mentions the Doctrine classes that aren't found in this project, perhaps?

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@xabbuhxabbuhAwaiting requested review from xabbuhxabbuh is a code owner

1 more reviewer

@wkaniawkaniawkania approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@ker0x@wkania@toby-griffiths@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp