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

« back to all changes in this revision

Viewing changes to lib/form/doctrine/agGisPlugin/base/BaseagGeoForm.class.php

  • Committer: charles wisniewski
  • Date: 2010-12-08 22:06:31 UTC
  • mfrom: (1.1.3 cuny-sps-trunk)
  • Revision ID: charles.wisniewski@mail.cuny.edu-20101208220631-63o0t8b9vi7nbbu6
all up to date

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
 
 
3
/**
 
4
 * agGeo form base class.
 
5
 *
 
6
 * @method agGeo 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 BaseagGeoForm extends BaseFormDoctrine
 
14
{
 
15
  public function setup()
 
16
  {
 
17
    $this->setWidgets(array(
 
18
      'id'            => new sfWidgetFormInputHidden(),
 
19
      'geo_type_id'   => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('agGeoType'), 'add_empty' => false)),
 
20
      'geo_source_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('agGeoSource'), 'add_empty' => false)),
 
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
      'geo_type_id'   => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('agGeoType'))),
 
28
      'geo_source_id' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('agGeoSource'))),
 
29
      'created_at'    => new sfValidatorDateTime(),
 
30
      'updated_at'    => new sfValidatorDateTime(),
 
31
    ));
 
32
 
 
33
    $this->widgetSchema->setNameFormat('ag_geo[%s]');
 
34
 
 
35
    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
 
36
 
 
37
    $this->setupInheritance();
 
38
 
 
39
    parent::setup();
 
40
  }
 
41
 
 
42
  public function getModelName()
 
43
  {
 
44
    return 'agGeo';
 
45
  }
 
46
 
 
47
}
 
 
b'\\ No newline at end of file'