Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?php
2
 
3
/**
4
 * Movie form base class.
5
 *
6
 * @method Movie 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 BaseMovieForm extends BaseFormPropel
13
{
14
  public function setup()
15
  {
16
    $this->setWidgets(array(
17
      'id'       => new sfWidgetFormInputHidden(),
18
      'director' => new sfWidgetFormInputText(),
19
    ));
20
 
21
    $this->setValidators(array(
22
      'id'       => new sfValidatorChoice(array('choices' => array($this->getObject()->getId()), 'empty_value' => $this->getObject()->getId(), 'required' => false)),
23
      'director' => new sfValidatorString(array('max_length' => 255, 'required' => false)),
24
    ));
25
 
26
    $this->widgetSchema->setNameFormat('movie[%s]');
27
 
28
    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
29
 
30
    parent::setup();
31
  }
32
 
33
  public function getModelName()
34
  {
35
    return 'Movie';
36
  }
37
 
38
  public function getI18nModelName()
39
  {
40
    return 'MovieI18n';
41
  }
42
 
43
  public function getI18nFormClass()
44
  {
45
    return 'MovieI18nForm';
46
  }
47
 
48
}