Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
Closed
Description
I have multiple kinds of entities within a single table inheritance. The UniqueEntityValidator fails in that scenario as it usesget_class($entity)
. It instead should use the class on which it is defined.
Example:
/** * @ORM\InheritanceType("SINGLE_TABLE") * @ORM\DiscriminatorColumn(name="discr", type="string", length=15) * @UniqueEntity(fields={"email"}) */class User {/** @ORM\Column(type="string") */private$email;}
class Collaboratorextends User {}
Validating theCollaborator
will now only check for otherCollaborator
s with the same email.
I'm using symfony2.7.10
.