Here is the schema of two tables that I am querying in doctrine.
I have two tables in my schema called taxonomy and lesson, which have a many to one relation [should really be one to one, but that's how it has been encoded]. My query is encoded in TaxonomyTable.class.php
like this:
$this->createQuery('t.*, l.lid')
->innerJoin('t.Lesson l')
->where('t.section = ?','specific_section');
The query executes as it should, the challenge really is accessing lesson lid.
Assuming the query is executed and stored in a variable $TaxonomyResults
;
From prior posts, I understand that it can be done like this:
foreach($TaxonomyResults as $TaxonomyResult)
{
echo $TaxonomyResult->getLesson()->getLid();
}
But simply put, this does not work for me and I am not sure why. The error that renders across my screen is:
'Doctrine_Collection' does not have a method 'getLid'.
What do you think I am doing wrong here?