在模块操作中,根据主键ID以外的索引选择记录的最佳方式是什么?symfony查询问题
$this->city = Doctrine::getTable('City')->find(array($request->getParameter('city')));
这总是返回与WHERE City.id= instead of WHERE City.city=
查询我必须做一些像
$q = Doctrine_Query::create()
->from('City j')
->where('j.city = ?', $request->getParameter('city'));
$this->city=$q->execute();
它更具可读性。非常感谢你的指导 – 2010-08-14 17:23:27