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 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. example@example.com and webinar_id
6 and user2 verification.
Comments
Post a Comment