Skip to content

display custom message for uniqueEntity constraint #13787

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed

display custom message for uniqueEntity constraint #13787

wants to merge 4 commits into from

Conversation

jamyouss
Copy link

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets -
License MIT
Doc PR -

Add the possibility to have custom message for unique entity constraint.
For example if we have a collection of entities in a form, the message can be more expressive.

Example:

/**
 * Town
 *
 * @ORM\Entity()
 * @UniqueEntity(fields={"city"}, message="The city '{{ city }}' is already used.")
 */
class Town
{

@jamyouss jamyouss closed this May 13, 2015
@jamyouss jamyouss deleted the uniqueEntityCustomMessage branch May 13, 2015 12:33
@Minishlink
Copy link

Hello,
Why did you delete this PR? It's a good enhancement !

@jamyouss jamyouss restored the uniqueEntityCustomMessage branch July 4, 2015 16:12
@jamyouss
Copy link
Author

jamyouss commented Jul 4, 2015

Hi,
I accidentally closed it but hadn't time to reopen it and find out why it didn't pass travis test :-(
I recreate it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants