-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Closed
Description
I have multiple kinds of entities within a single table inheritance. The UniqueEntityValidator fails in that scenario as it uses get_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 Collaborator extends User {}
Validating the Collaborator
will now only check for other Collaborator
s with the same email.
I'm using symfony 2.7.10
.