Changeset [020dba5089b9abb96ddff7e77fafa197ada9af67] by Andrew Ho

July 7th, 2009 @ 11:06 PM

Improved some validation rules

(i) Made isValidParentId() more generic so that it can validate against any model and any column name (with the default of column id' in the current model).

(ii) Renamed isUniqueFieldAmongstPeers() to isUniqueNodeAmongstPeers() to better describe what it does.

(iii) Wrote isPositiveInteger as it turns out that using array('decimal', 0) as a validation rule doesn't actually do what I want it to. Whilst I could've used array('custom', '/^\d+$/') as the rule, this uses preg_match which is quite expensive in terms of performance, so I use a combination of is_int() and ctype_digit(). If that doesn't quite make sense, then just look at lines 141-150 in www/app/app_model.php. http://github.com/kenners/uamuzi...

Committed by Andrew Ho

  • M www/app/app_model.php
  • M www/app/models/location.php
  • M www/app/models/patient.php
  • M www/app/models/vf_testing_site.php
New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

A basic HIV Electronic Medical Record (EMR) system using CakePHP.

Shared Ticket Bins