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
 * Product form base class.
5
 *
6
 * @method Product 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 BaseProductForm extends BaseFormPropel
13
{
14
  public function setup()
15
  {
16
    $this->setWidgets(array(
17
      'id'               => new sfWidgetFormInputHidden(),
18
      'price'            => new sfWidgetFormInputText(),
19
      'a_primary_string' => new sfWidgetFormInputText(),
20
    ));
21
 
22
    $this->setValidators(array(
23
      'id'               => new sfValidatorChoice(array('choices' => array($this->getObject()->getId()), 'empty_value' => $this->getObject()->getId(), 'required' => false)),
24
      'price'            => new sfValidatorNumber(array('required' => false)),
25
      'a_primary_string' => new sfValidatorString(array('max_length' => 64, 'required' => false)),
26
    ));
27
 
28
    $this->widgetSchema->setNameFormat('product[%s]');
29
 
30
    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
31
 
32
    parent::setup();
33
  }
34
 
35
  public function getModelName()
36
  {
37
    return 'Product';
38
  }
39
 
40
  public function getI18nModelName()
41
  {
42
    return 'ProductI18n';
43
  }
44
 
45
  public function getI18nFormClass()
46
  {
47
    return 'ProductI18nForm';
48
  }
49
 
50
}