php - Symfony left join query -
i've got following query running correctly:
$q = $this->createquery('e') ->where('e.persons_iduser =?', $request) ->leftjoin('e.jobtitles jt') ->leftjoin('e.employmentlevels el');
but when i'm iterate through result , try access fields left join:
foreach ($work $w){ echo $w->employername; echo $w->jobtitle; // left join echo $w->employmentlevel; // left join }
i got following error message: unknown record property / related component "jobtitle" on "experiences"
anyone got clue? how echo field left join?
<?php foreach ($work $w){ echo $w->employername; foreach($w->jobtitles $job){ echo $job->jobtitle; // left join } foreach($w->employmentlevels $employ){ echo $employ->employmentlevel; // left join } } ?>
this work symfony returns array of objects , elements join table come under child array
Comments
Post a Comment