Form.Class のウィジェットは次のとおりです。
$this->widgetSchema['schools'] = new sfWidgetFormChoice(array(
'choices' => Doctrine_Core::getTable('school')->getUsersSchools($userId),
'renderer_class' => 'sfWidgetFormSelectDoubleList',
'renderer_options' => array(
'label_unassociated' => 'Unassociated',
'label_associated' => 'Associated'
)));
上記は問題なく機能しますが、保存されている値は上記の選択リストに関連付けられていません。取得した配列の ID を値として保存する必要があります。代わりに、取得されるリストは時系列であり、ID は無視されます。
schoolTable クエリは次のとおりです。
public function getUsersSchools($id){
$q =Doctrine_Query::create()
->select('id')
->from('school')
->where('user_id = ?', $id)
->execute();
return $q;
}