Class: I2CE Validate (Development): Difference between revisions

From IHRIS Wiki
(Created page with '{{otherversions|Class: I2CE_Validate}} This article describes the class ''I2CE_Validate'' . *Location: Part of the module I2CE in the pack…')
 
No edit summary
Line 5: Line 5:
==Variables==
==Variables==
===$false===
===$false===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_Validate.php#L136 i2ce/lib/I2CE_Validate.php] on line 136
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_Validate.php#L137 i2ce/lib/I2CE_Validate.php] on line 137
*Type: static protected $false
*Type: static protected $false


===$true===
===$true===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_Validate.php#L137 i2ce/lib/I2CE_Validate.php] on line 137
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_Validate.php#L138 i2ce/lib/I2CE_Validate.php] on line 138
*Type: static protected $true
*Type: static protected $true


===$BaseChar===
===$BaseChar===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_Validate.php#L264 i2ce/lib/I2CE_Validate.php] on line 264
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_Validate.php#L265 i2ce/lib/I2CE_Validate.php] on line 265
*Type: static protected $BaseChar
*Type: static protected $BaseChar


===$Ideographic===
===$Ideographic===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_Validate.php#L265 i2ce/lib/I2CE_Validate.php] on line 265
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_Validate.php#L266 i2ce/lib/I2CE_Validate.php] on line 266
*Type: static protected $Ideographic
*Type: static protected $Ideographic


===$Letter===
===$Letter===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_Validate.php#L266 i2ce/lib/I2CE_Validate.php] on line 266
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_Validate.php#L267 i2ce/lib/I2CE_Validate.php] on line 267
*Type: static protected $Letter
*Type: static protected $Letter


===$Digit===
===$Digit===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_Validate.php#L267 i2ce/lib/I2CE_Validate.php] on line 267
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_Validate.php#L268 i2ce/lib/I2CE_Validate.php] on line 268
*Type: static protected $Digit
*Type: static protected $Digit


===$CombiningChar===
===$CombiningChar===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_Validate.php#L268 i2ce/lib/I2CE_Validate.php] on line 268
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_Validate.php#L269 i2ce/lib/I2CE_Validate.php] on line 269
*Type: static protected $CombiningChar
*Type: static protected $CombiningChar


===$Extender===
===$Extender===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_Validate.php#L269 i2ce/lib/I2CE_Validate.php] on line 269
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_Validate.php#L270 i2ce/lib/I2CE_Validate.php] on line 270
*Type: static protected $Extender
*Type: static protected $Extender


===$NameChar===
===$NameChar===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_Validate.php#L270 i2ce/lib/I2CE_Validate.php] on line 270
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_Validate.php#L271 i2ce/lib/I2CE_Validate.php] on line 271
*Type: static protected $NameChar
*Type: static protected $NameChar


===$Name===
===$Name===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_Validate.php#L271 i2ce/lib/I2CE_Validate.php] on line 271
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_Validate.php#L272 i2ce/lib/I2CE_Validate.php] on line 272
*Type: static protected $Name
*Type: static protected $Name


===$tokenRegexps===
===$tokenRegexps===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_Validate.php#L272 i2ce/lib/I2CE_Validate.php] on line 272
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_Validate.php#L273 i2ce/lib/I2CE_Validate.php] on line 273
*Type: static protected $tokenRegexps
*Type: static protected $tokenRegexps


Line 51: Line 51:
===checkCurrency()===
===checkCurrency()===
Checks to make sure currency is valid. This method checks to make sure a number is valid for currency.  It can have a decimal or comma with 2 digits past.
Checks to make sure currency is valid. This method checks to make sure a number is valid for currency.  It can have a decimal or comma with 2 digits past.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_Validate.php#L97 i2ce/lib/I2CE_Validate.php] on line 97
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_Validate.php#L98 i2ce/lib/I2CE_Validate.php] on line 98
*Signature: static public function checkCurrency($data)
*Signature: static public function checkCurrency($data)
*Parameters:
*Parameters:
Line 58: Line 58:
===checkDate()===
===checkDate()===
Checks to make sure a date is valid
Checks to make sure a date is valid
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_Validate.php#L129 i2ce/lib/I2CE_Validate.php] on line 129
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_Validate.php#L130 i2ce/lib/I2CE_Validate.php] on line 130
*Signature: static public function checkDate($data)
*Signature: static public function checkDate($data)
*Parameters:
*Parameters:
Line 64: Line 64:
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ]
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ]
===checkEmail()===
===checkEmail()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_Validate.php#L108 i2ce/lib/I2CE_Validate.php] on line 108
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_Validate.php#L109 i2ce/lib/I2CE_Validate.php] on line 109
*Signature: static public function checkEmail($email)
*Signature: static public function checkEmail($email)
*Parameters:
*Parameters:
Line 93: Line 93:
===checkVersion()===
===checkVersion()===
Checks to see if the versions  meet the demans given by the operator. Opeartors are '<','lessthan','>','greaterthan','=','equal','equals','exactly','<=','atmost','>=','atleast'
Checks to see if the versions  meet the demans given by the operator. Opeartors are '<','lessthan','>','greaterthan','=','equal','equals','exactly','<=','atmost','>=','atleast'
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_Validate.php#L178 i2ce/lib/I2CE_Validate.php] on line 178
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_Validate.php#L179 i2ce/lib/I2CE_Validate.php] on line 179
*Signature: static public function checkVersion($vers1,$operator,$vers2)
*Signature: static public function checkVersion($vers1,$operator,$vers2)
*Parameters:
*Parameters:
Line 102: Line 102:
===convertToBoolean()===
===convertToBoolean()===
Converts a string such as true/false/yes/no/1/0  to boolean value (stored as either the string '0' or '1')
Converts a string such as true/false/yes/no/1/0  to boolean value (stored as either the string '0' or '1')
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_Validate.php#L144 i2ce/lib/I2CE_Validate.php] on line 144
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_Validate.php#L145 i2ce/lib/I2CE_Validate.php] on line 145
*Signature: static public function convertToBoolean($string,$asBool)
*Signature: static public function convertToBoolean($string,$asBool)
*Parameters:
*Parameters:
Line 110: Line 110:
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php mixed ]<br/>string or null if it is not recognized
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php mixed ]<br/>string or null if it is not recognized
===isNmToken()===
===isNmToken()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_Validate.php#L299 i2ce/lib/I2CE_Validate.php] on line 299
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_Validate.php#L300 i2ce/lib/I2CE_Validate.php] on line 300
*Signature: static public function isNmToken($val)
*Signature: static public function isNmToken($val)
*Parameters:
*Parameters:
**$val  
**$val  
===isTokenDigit()===
===isTokenDigit()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_Validate.php#L283 i2ce/lib/I2CE_Validate.php] on line 283
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_Validate.php#L284 i2ce/lib/I2CE_Validate.php] on line 284
*Signature: static public function isTokenDigit($val)
*Signature: static public function isTokenDigit($val)
*Parameters:
*Parameters:
**$val  
**$val  
===isTokenLetter()===
===isTokenLetter()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_Validate.php#L289 i2ce/lib/I2CE_Validate.php] on line 289
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_Validate.php#L290 i2ce/lib/I2CE_Validate.php] on line 290
*Signature: static public function isTokenLetter($val)
*Signature: static public function isTokenLetter($val)
*Parameters:
*Parameters:
**$val  
**$val  
===isTokenName()===
===isTokenName()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_Validate.php#L294 i2ce/lib/I2CE_Validate.php] on line 294
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_Validate.php#L295 i2ce/lib/I2CE_Validate.php] on line 295
*Signature: static public function isTokenName($val)
*Signature: static public function isTokenName($val)
*Parameters:
*Parameters:
**$val  
**$val  
===setupTokenRegexps()===
===setupTokenRegexps()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_Validate.php#L273 i2ce/lib/I2CE_Validate.php] on line 273
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_Validate.php#L274 i2ce/lib/I2CE_Validate.php] on line 274
*Signature: protected function setupTokenRegexps()
*Signature: protected function setupTokenRegexps()
===stripCurrency()===
===stripCurrency()===
Remove any invalid characters that can't be part of a valid currency value.
Remove any invalid characters that can't be part of a valid currency value.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_Validate.php#L118 i2ce/lib/I2CE_Validate.php] on line 118
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/lib/I2CE_Validate.php#L119 i2ce/lib/I2CE_Validate.php] on line 119
*Signature: static public function stripCurrency($data)
*Signature: static public function stripCurrency($data)
*Parameters:
*Parameters:

Revision as of 08:55, 27 May 2010


This article describes the class I2CE_Validate .

Variables

$false

$true

$BaseChar

$Ideographic

$Letter

$Digit

$CombiningChar

$Extender

$NameChar

$Name

$tokenRegexps

Methods

checkCurrency()

Checks to make sure currency is valid. This method checks to make sure a number is valid for currency. It can have a decimal or comma with 2 digits past.

checkDate()

Checks to make sure a date is valid

checkEmail()

checkMap()

Checks to make sure a mapped value is valid. Map values are saved as an array( "form", "id" );

checkNumber()

Checks to make sure a number is valid This method checks to make sure the number is a number and optionally that it is greater than a specific value.

  • Defined in i2ce/lib/I2CE_Validate.php on line 59
  • Signature: static public function checkNumber($data,$min_value)
  • Parameters:
    • number $data
    • number $min_value
      • Default Value: false
  • Returns: boolean

checkString()

Checks to make sure a string isn't blank.

checkVersion()

Checks to see if the versions meet the demans given by the operator. Opeartors are '<','lessthan','>','greaterthan','=','equal','equals','exactly','<=','atmost','>=','atleast'

  • Defined in i2ce/lib/I2CE_Validate.php on line 179
  • Signature: static public function checkVersion($vers1,$operator,$vers2)
  • Parameters:
    • $vers1
    • $operator
    • $vers2
  • Returns: true
    on sucess. false on failure

convertToBoolean()

Converts a string such as true/false/yes/no/1/0 to boolean value (stored as either the string '0' or '1')

  • Defined in i2ce/lib/I2CE_Validate.php on line 145
  • Signature: static public function convertToBoolean($string,$asBool)
  • Parameters:
    • string $string
    • boolean $asBool
      Defaults to false. If true returns true/false otherwise returns 1/0. I know ... this is confusing.
      • Default Value: false
  • Returns: mixed
    string or null if it is not recognized

isNmToken()

isTokenDigit()

isTokenLetter()

isTokenName()

setupTokenRegexps()

stripCurrency()

Remove any invalid characters that can't be part of a valid currency value.