I'm using Symfony 1.4 with Doctrine, and have this situation:
I have a table A that holds common fields, and 3 more tables B, C and D which all have a foreign key to A (a_id), and extra fields specific to each one.
In my model, I'm writing the following query:
public function getAllFields(){
$query = Doctrine_Core::getTable('A')
->createQuery('a')
->leftJoin('a.B b')
->leftJoin('a.C c')
->leftJoin('a.D d');
$result = $query->execute();
return $result;
Having that data (a DoctrineCollection), I need to iterate it in my view to fill a grid. The thing is that I need to specify in that list, the type of the record (that'd be whether it belongs to the table B, C, or D). How can I know from which table each field comes from?