| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
class BaseLocalEventForm extends BaseFormPropel |
|---|
| 11 |
{ |
|---|
| 12 |
public function setup() |
|---|
| 13 |
{ |
|---|
| 14 |
$this->setWidgets(array( |
|---|
| 15 |
'id' => new sfWidgetFormInputHidden(), |
|---|
| 16 |
'owner_id' => new sfWidgetFormPropelSelect(array('model' => 'sfGuardUser', 'add_empty' => false)), |
|---|
| 17 |
'title' => new sfWidgetFormInput(), |
|---|
| 18 |
'slug' => new sfWidgetFormInput(), |
|---|
| 19 |
'description' => new sfWidgetFormTextarea(), |
|---|
| 20 |
'city' => new sfWidgetFormInput(), |
|---|
| 21 |
'country' => new sfWidgetFormInput(), |
|---|
| 22 |
'start_at' => new sfWidgetFormDateTime(), |
|---|
| 23 |
'end_at' => new sfWidgetFormDateTime(), |
|---|
| 24 |
'created_at' => new sfWidgetFormDateTime(), |
|---|
| 25 |
'updated_at' => new sfWidgetFormDateTime(), |
|---|
| 26 |
)); |
|---|
| 27 |
|
|---|
| 28 |
$this->setValidators(array( |
|---|
| 29 |
'id' => new sfValidatorPropelChoice(array('model' => 'LocalEvent', 'column' => 'id', 'required' => false)), |
|---|
| 30 |
'owner_id' => new sfValidatorPropelChoice(array('model' => 'sfGuardUser', 'column' => 'id')), |
|---|
| 31 |
'title' => new sfValidatorString(array('max_length' => 255)), |
|---|
| 32 |
'slug' => new sfValidatorString(array('max_length' => 255)), |
|---|
| 33 |
'description' => new sfValidatorString(), |
|---|
| 34 |
'city' => new sfValidatorString(array('max_length' => 255)), |
|---|
| 35 |
'country' => new sfValidatorString(array('max_length' => 2)), |
|---|
| 36 |
'start_at' => new sfValidatorDateTime(), |
|---|
| 37 |
'end_at' => new sfValidatorDateTime(array('required' => false)), |
|---|
| 38 |
'created_at' => new sfValidatorDateTime(array('required' => false)), |
|---|
| 39 |
'updated_at' => new sfValidatorDateTime(array('required' => false)), |
|---|
| 40 |
)); |
|---|
| 41 |
|
|---|
| 42 |
$this->widgetSchema->setNameFormat('local_event[%s]'); |
|---|
| 43 |
|
|---|
| 44 |
$this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema); |
|---|
| 45 |
|
|---|
| 46 |
parent::setup(); |
|---|
| 47 |
} |
|---|
| 48 |
|
|---|
| 49 |
public function getModelName() |
|---|
| 50 |
{ |
|---|
| 51 |
return 'LocalEvent'; |
|---|
| 52 |
} |
|---|
| 53 |
|
|---|
| 54 |
|
|---|
| 55 |
} |
|---|
| 56 |
|
|---|