0
我有它正确地运行下面的查询:Symfony的左连接查询
$q = $this->createQuery('e')
->where('e.Persons_idUser =?', $request)
->leftJoin('e.JobTitles jt')
->leftJoin('e.EmploymentLevels el');
,但是当我遍历结果,并尝试从左边的领域加入:
foreach ($work as $w){
echo $w->employername;
echo $w->jobtitle; // this is from the left join
echo $w->employmentlevel; // this is from the left join
}
,我得到了以下错误消息: 未知记录属性/相关组件“JOBTITLE”的“经验”
任何人都得到了线索?我如何回应左连接的字段?
你需要做的是这样'$ W- > EmploymentLevels-> employmentlevel' – 2010-11-16 14:19:36
谢谢!那是我的问题。 – jorgen 2010-11-16 14:42:08