|
Moodle
2.2.1
http://www.collinsharper.com
|


Public Member Functions | |
| __construct ($options=null) | |
| getLocale () | |
| setLocale ($locale=null) | |
| getFormat () | |
| setFormat ($format) | |
| isValid ($value) | |
Data Fields | |
| const | INVALID = 'postcodeInvalid' |
| const | NO_MATCH = 'postcodeNoMatch' |
Protected Attributes | |
| $_messageTemplates | |
| $_locale | |
| $_format | |
Definition at line 38 of file PostCode.php.
| __construct | ( | $ | options = null | ) |
Constructor for the integer validator
Accepts either a string locale, a Zend_Locale object, or an array or Zend_Config object containing the keys "locale" and/or "format".
| string | Zend_Locale | array | Zend_Config | $options |
| Zend_Validate_Exception | On empty format |
Definition at line 74 of file PostCode.php.

| getFormat | ( | ) |
Returns the set postal code format
Definition at line 155 of file PostCode.php.

| getLocale | ( | ) |
Returns the set locale
Definition at line 111 of file PostCode.php.
| isValid | ( | $ | value | ) |
Defined by Zend_Validate_Interface
Returns true if and only if $value is a valid postalcode
| string | $value |
Implements Zend_Validate_Interface.
Definition at line 194 of file PostCode.php.

| setFormat | ( | $ | format | ) |
Sets a self defined postal format as regex
| string | $format |
| Zend_Validate_Exception | On empty format |
Definition at line 167 of file PostCode.php.

| setLocale | ( | $ | locale = null | ) |
Sets the locale to use
| string | Zend_Locale | $locale |
| Zend_Validate_Exception | On unrecognised region |
| Zend_Validate_Exception | On not detected format |
Definition at line 124 of file PostCode.php.


$_format [protected] |
Definition at line 63 of file PostCode.php.
$_locale [protected] |
Definition at line 56 of file PostCode.php.
$_messageTemplates [protected] |
array( self::INVALID => "Invalid type given. The value should be a string or a integer", self::NO_MATCH => "'%value%' does not appear to be a postal code", )
Reimplemented from Zend_Validate_Abstract.
Definition at line 46 of file PostCode.php.
| const INVALID = 'postcodeInvalid' |
Definition at line 40 of file PostCode.php.
| const NO_MATCH = 'postcodeNoMatch' |
Definition at line 41 of file PostCode.php.