lets say I have a single table inheritance classes like in the doctrine documentation example. The Employee entity has a new property $account:
<?php
namespace MyProject\Model;
/**
* @Entity
* @InheritanceType("SINGLE_TABLE")
* @DiscriminatorColumn(name="discr", type="string")
* @DiscriminatorMap({"person" = "Person", "employee" = "Employee"})
*/
class Person
{
// ...
}
/**
* @Entity
*/
class Employee extends Person
{
/**
* @ORM\ManyToOne(targetEntity="Account")
* @ORM\JoinColumn(nullable=true)
*
* @var Account
*/
protected $account;
}
How can I get all the Person entities using DQL with a (eager) joined Account entities in case the Person is an instance of Employee as i cannot write a standard leftJoin because the Person enity has no property Account?
Thanks