1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
abstract class BaseEventParticipantForm extends BaseFormDoctrine
{
public function setup()
{
$this->setWidgets(array(
'event_id' => new sfWidgetFormInputHidden(),
'member_id' => new sfWidgetFormInputText(),
'is_notified' => new sfWidgetFormInputText(),
'is_accepted' => new sfWidgetFormInputText(),
'is_guested' => new sfWidgetFormInputText(),
'motivation' => new sfWidgetFormTextarea(),
));
$this->setValidators(array(
'member_id' => new sfValidatorDoctrineChoice(array('model' => $this->getModelName(), 'column' => 'member_id', 'required' => false)),
'is_notified' => new sfValidatorInteger(array('required' => false)),
'is_accepted' => new sfValidatorInteger(array('required' => false)),
'is_guested' => new sfValidatorInteger(array('required' => false)),
'motivation' => new sfValidatorString(array('max_length' => 300, 'required' => false)),
));
$this->widgetSchema->setNameFormat('event_participants[%s]');
$this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
$this->setupInheritance();
parent::setup();
}
public function getModelName()
{
return 'EventParticipant';
}
} |
Partager