~agasti-rhok-02/sahana-agasti/mayon-rhok-02

« back to all changes in this revision

Viewing changes to lib/form/doctrine/base/BaseagEntityRelationshipTypeForm.class.php

  • Committer: Chad Heuschober
  • Date: 2010-12-04 04:01:41 UTC
  • mfrom: (1.2.1 mayon)
  • Revision ID: chad.heuschober@mail.cuny.edu-20101204040141-orjw950gt411jzmt
Merged changes from r2 of project trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
 
 
3
/**
 
4
 * agEntityRelationshipType form base class.
 
5
 *
 
6
 * @method agEntityRelationshipType getObject() Returns the current form's model object
 
7
 *
 
8
 * @package    AGASTI_CORE
 
9
 * @subpackage form
 
10
 * @author     CUNY SPS
 
11
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 
12
 */
 
13
abstract class BaseagEntityRelationshipTypeForm extends BaseFormDoctrine
 
14
{
 
15
  public function setup()
 
16
  {
 
17
    $this->setWidgets(array(
 
18
      'id'                            => new sfWidgetFormInputHidden(),
 
19
      'entity_relationship_type'      => new sfWidgetFormInputText(),
 
20
      'entity_relationship_type_desc' => new sfWidgetFormInputText(),
 
21
      'created_at'                    => new sfWidgetFormDateTime(),
 
22
      'updated_at'                    => new sfWidgetFormDateTime(),
 
23
    ));
 
24
 
 
25
    $this->setValidators(array(
 
26
      'id'                            => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
 
27
      'entity_relationship_type'      => new sfValidatorString(array('max_length' => 32)),
 
28
      'entity_relationship_type_desc' => new sfValidatorString(array('max_length' => 255, 'required' => false)),
 
29
      'created_at'                    => new sfValidatorDateTime(),
 
30
      'updated_at'                    => new sfValidatorDateTime(),
 
31
    ));
 
32
 
 
33
    $this->validatorSchema->setPostValidator(
 
34
      new sfValidatorDoctrineUnique(array('model' => 'agEntityRelationshipType', 'column' => array('entity_relationship_type')))
 
35
    );
 
36
 
 
37
    $this->widgetSchema->setNameFormat('ag_entity_relationship_type[%s]');
 
38
 
 
39
    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
 
40
 
 
41
    $this->setupInheritance();
 
42
 
 
43
    parent::setup();
 
44
  }
 
45
 
 
46
  public function getModelName()
 
47
  {
 
48
    return 'agEntityRelationshipType';
 
49
  }
 
50
 
 
51
}
 
 
b'\\ No newline at end of file'