My goal is to inherit an already inherited table with doctrine. I've got an abstract user class...
<?php
namespace UserBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use FOS\UserBundle\Model\User as BaseUser;
/**
* @ORM\Entity
* @ORM\InheritanceType("JOINED")
* @ORM\DiscriminatorColumn(name="type", type="string")
* @ORM\DiscriminatorMap( {"student" = "Student", "employee" = "Employee", "customer" = "Customer"} )
*/
abstract class User extends BaseUser
{
}
...and various subclasses (student, customer, employee). Like this one:
<?php
namespace UserBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* UserBundle\Entity\Student
*
* @ORM\Entity
*/
class Student extends User
{
}
Within this setup everything is just working fine. Now other bundles, seen as individual modules, should add up columns from the sub-classes. Therefor I like to inherit from these classes like student. But those can't be abstract, because they are used by the core system.
Is it possible to solve this with doctrine class table inheritance? And if not, which solution would you recommend?