| 1 |
lars |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
/**
|
|
|
4 |
* MovieI18n form base class.
|
|
|
5 |
*
|
|
|
6 |
* @method MovieI18n getObject() Returns the current form's model object
|
|
|
7 |
*
|
|
|
8 |
* @package ##PROJECT_NAME##
|
|
|
9 |
* @subpackage form
|
|
|
10 |
* @author Your name here
|
|
|
11 |
*/
|
|
|
12 |
abstract class BaseMovieI18nForm extends BaseFormPropel
|
|
|
13 |
{
|
|
|
14 |
public function setup()
|
|
|
15 |
{
|
|
|
16 |
$this->setWidgets(array(
|
|
|
17 |
'id' => new sfWidgetFormInputHidden(),
|
|
|
18 |
'culture' => new sfWidgetFormInputHidden(),
|
|
|
19 |
'title' => new sfWidgetFormInputText(),
|
|
|
20 |
));
|
|
|
21 |
|
|
|
22 |
$this->setValidators(array(
|
|
|
23 |
'id' => new sfValidatorPropelChoice(array('model' => 'Movie', 'column' => 'id', 'required' => false)),
|
|
|
24 |
'culture' => new sfValidatorChoice(array('choices' => array($this->getObject()->getCulture()), 'empty_value' => $this->getObject()->getCulture(), 'required' => false)),
|
|
|
25 |
'title' => new sfValidatorString(array('max_length' => 255, 'required' => false)),
|
|
|
26 |
));
|
|
|
27 |
|
|
|
28 |
$this->validatorSchema->setPostValidator(
|
|
|
29 |
new sfValidatorPropelUnique(array('model' => 'MovieI18n', 'column' => array('title')))
|
|
|
30 |
);
|
|
|
31 |
|
|
|
32 |
$this->widgetSchema->setNameFormat('movie_i18n[%s]');
|
|
|
33 |
|
|
|
34 |
$this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
|
|
|
35 |
|
|
|
36 |
parent::setup();
|
|
|
37 |
}
|
|
|
38 |
|
|
|
39 |
public function getModelName()
|
|
|
40 |
{
|
|
|
41 |
return 'MovieI18n';
|
|
|
42 |
}
|
|
|
43 |
|
|
|
44 |
|
|
|
45 |
}
|