symfony - UniqueEntity Validation on Column+ManyToOne Relationship -


I tried to create a multi-column unique verification barrier, but it will not work. Here's my model: UserInterface * / class * user * * @ORM \ unit * @UniqueEntity ({"webinar", "email"}) * / class user, \ Serializable {... / ** * @var string * * @ORM \ column (name = "email", type = "string", length = 255) * @Assert \ NotBlank () * @Assert \ email () * @Assert \ Length (max = "255") * / Private $ Email; ... / ** * @ORM \ ManyToOne (targetEntity = "Wefra \ ADHSWebinarBundle \ unit \ webinar", inversedBy = "registeredUsers") * @ORM \ JoinColumn (name = "webinar_id", referencedColumnName = "ID") * / Private $ webinar; ...}

Whatever is happening, even if there is no error matching the verification in both the columns.

e.g. User1 tries to register with the same data without causing an error to the email example@example.com and webinar_id 6 and user2 verification.

I post using "Symfony2.5

Oh, I found the problem . The webinar was not set up when validating the model. I had to set up webinar_id before validating the model.

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -