I've two entities: Act and Birth with Birth which extends Act like that
/**
* Act
*
* @ORM\InheritanceType("JOINED")
*
* @ORM\Entity(repositoryClass="AppBundle\Repository\ActRepository")
*/
class Act
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="type", type="string", length=30, nullable=true)
*/
private $type;
}
/**
* Birth
*
* @ORM\Table(name="birth")
* @ORM\Entity(repositoryClass="AppBundle\Repository\BirthRepository")
*/
class Birth extends Acte
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
}
And when I create a birth instance
new Birth();
I would like to recover the instance of its super class ie Act Entity ! I have to assign it to another class (Individual) with individual->setAct() and not individu->setBirth() ...
I do not know if it's possible but I want some advice for another approach Thanks !