1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| public function setup()
{
$this->setWidgets(array(
'id' => new sfWidgetFormInputHidden(),
'start_time' => new sfWidgetFormTime(),
'end_time' => new sfWidgetFormTime(),
'typical_day_id' => new sfWidgetFormDoctrineChoice(array('model' => 'TypicalDay', 'add_empty' => true)),
));
$this->setValidators(array(
'id' => new sfValidatorDoctrineChoice(array('model' => 'TypicalSchedule', 'column' => 'id', 'required' => false)),
'start_time' => new sfValidatorTime(),
'end_time' => new sfValidatorTime(),
'typical_day_id' => new sfValidatorDoctrineChoice(array('model' => 'TypicalDay', 'required' => false)),
));
$this->widgetSchema->setNameFormat('typical_schedule[%s]');
$this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
parent::setup();
} |
Partager