I am asking for your help because today I am having a legacy problem.
I have a Holder class which inherits from the User class. I would like to associate a user with several holders with inheritance and without creating a ManyToOne relationship, but the inheritance creates a key duplication problem on Holder.
The idea is to have a Business, Merchant, personal, etc. Holder associated with a single user.
Thanks for your help.
User class :
#[ORM\Entity(repositoryClass: UserRepository::class)]
//#[UniqueEntity('phoneNumber', message: "This phone number is already used")]
#[ORM\InheritanceType("JOINED")]
#[ORM\DiscriminatorColumn("user_type")]
#[ORM\DiscriminatorMap(["holder" => "Holder", "employee" => "Employee"])]
abstract class User implements UserInterface, PasswordAuthenticatedUserInterface
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
}
Holder class :
class Holder extends User
{
....
}