Created
April 20, 2012 11:59
-
-
Save Tocacar/2428052 to your computer and use it in GitHub Desktop.
DoctrineChoice query
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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