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
 * Book form base class.
5
 *
6
 * @method Book 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 BaseBookForm extends BaseFormPropel
13
{
14
  public function setup()
15
  {
16
    $this->setWidgets(array(
17
      'id'   => new sfWidgetFormInputHidden(),
18
      'name' => 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
      'name' => new sfValidatorString(array('max_length' => 255, 'required' => false)),
24
    ));
25
 
26
    $this->widgetSchema->setNameFormat('book[%s]');
27
 
28
    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
29
 
30
    parent::setup();
31
  }
32
 
33
  public function getModelName()
34
  {
35
    return 'Book';
36
  }
37
 
38
 
39
}