Skip to content

Instantly share code, notes, and snippets.

@Tocacar
Created April 20, 2012 11:59
Show Gist options
  • Save Tocacar/2428052 to your computer and use it in GitHub Desktop.
Save Tocacar/2428052 to your computer and use it in GitHub Desktop.
DoctrineChoice query
$relatedStrainQuery = Doctrine_Query::create()
->select('id')
->from('Strain s')
->where('s.lab_id = ?', $this->getOption('pref_lab_id'));
$this->widgetSchema['strain_id'] = new sfWidgetFormDoctrineChoice(array(
'model' => $this->getRelatedModelName('Strain'),
'query' => $relatedStrainQuery,
'multiple' => false,
'add_empty' => true
));
//I tried with 'model' => 'Strain' as well, but it makes no difference
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment