在模塊操作中,根據主鍵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