I have two tables A and B. A have one or more registers in B. I want to join two tables and extract all information about A.
I do that:
Schema.yml
A:
fields.....
B:
fields...
relations:
A: { onDelete: CASCADE, local: a.id, foreign: b.id, foreignalias: AB }
And i try to do that...
$q = Doctrine_Query::create()
->from('A a')
->leftJoin('a.AB b')
->where('a.field = "D"')
->andWhere('b.codzon = ?', $this->cp);
It prints me error: Unknown relation alias AB What i am doing wrong?