Skip to Content.
Sympa Menu

comanage-dev - [comanage-dev] r253 - registry/trunk/app/Model

Subject: COmanage Developers List

List archive

[comanage-dev] r253 - registry/trunk/app/Model


Chronological Thread 
  • From:
  • To:
  • Subject: [comanage-dev] r253 - registry/trunk/app/Model
  • Date: Mon, 12 Mar 2012 17:34:57 -0400

Author: marie
Date: 2012-03-12 17:34:57 -0400 (Mon, 12 Mar 2012)
New Revision: 253

Modified:
registry/trunk/app/Model/CoNsfDemographic.php
Log:
co-234 CoNsfDemographics needs validate for REST

Modified: registry/trunk/app/Model/CoNsfDemographic.php
===================================================================
--- registry/trunk/app/Model/CoNsfDemographic.php 2012-03-07 23:46:29
UTC (rev 252)
+++ registry/trunk/app/Model/CoNsfDemographic.php 2012-03-12 21:34:57
UTC (rev 253)
@@ -37,6 +37,48 @@

// Default ordering for find operations
public $order = array("CoNsfDemographic.id");
+
+ // Validation rules for table elements
+ public $validate = array(
+ 'co_person_id' => array(
+ 'rule' => 'numeric',
+ 'allowEmpty' => false,
+ 'message' => 'A CO Person ID must be provided'
+ ),
+ 'gender' => array(
+ 'rule' => array('inList', array(NSFGenderEnum::Male,
+ NSFGenderEnum::Female)),
+ 'required' => false
+ ),
+ 'citizenship' => array(
+ 'rule' => array('inList', array(NSFCitizenshipEnum::USCitizen,
+
NSFCitizenshipEnum::USPermanentResident,
+ NSFCitizenshipEnum::Other)),
+ 'required' => false
+ ),
+ 'ethnicity' => array(
+ 'rule' => array('inList', array(NSFEthnicityEnum::Hispanic,
+ NSFEthnicityEnum::NotHispanic)),
+ 'required' => false
+ ),
+ 'race' => array(
+ 'rule' => array('inList', array(NSFRaceEnum::Asian,
+ NSFRaceEnum::AmericanIndian,
+ NSFRaceEnum::Black,
+ NSFRaceEnum::NativeHawaiian,
+ NSFRaceEnum::White)),
+ 'required' => false,
+ 'allowEmpty' => true
+ ),
+ 'disability' => array(
+ 'rule' => array('inList', array(NSFDisabilityEnum::Hearing,
+ NSFDisabilityEnum::Visual,
+ NSFDisabilityEnum::Mobility,
+ NSFDisabilityEnum::Other)),
+ 'required' => false,
+ 'allowEmpty' => true
+ )
+ );

/**
* Encode demographic attributes for edit.



  • [comanage-dev] r253 - registry/trunk/app/Model, svnlog, 03/12/2012

Archive powered by MHonArc 2.6.16.

Top of Page