Moodle  2.2.1
http://www.collinsharper.com
Zend_Validate_PostCode Class Reference
Inheritance diagram for Zend_Validate_PostCode:
Collaboration diagram for Zend_Validate_PostCode:

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

Detailed Description

Definition at line 38 of file PostCode.php.


Constructor & Destructor Documentation

__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".

Parameters:
string | Zend_Locale | array | Zend_Config$options
Exceptions:
Zend_Validate_ExceptionOn empty format

Definition at line 74 of file PostCode.php.

Here is the call graph for this function:


Member Function Documentation

getFormat ( )

Returns the set postal code format

Returns:
string

Definition at line 155 of file PostCode.php.

Here is the caller graph for this function:

getLocale ( )

Returns the set locale

Returns:
string|Zend_Locale 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

Parameters:
string$value
Returns:
boolean

Implements Zend_Validate_Interface.

Definition at line 194 of file PostCode.php.

Here is the call graph for this function:

setFormat ( format)

Sets a self defined postal format as regex

Parameters:
string$format
Exceptions:
Zend_Validate_ExceptionOn empty format
Returns:
Zend_Validate_PostCode Provides fluid interface

Definition at line 167 of file PostCode.php.

Here is the caller graph for this function:

setLocale ( locale = null)

Sets the locale to use

Parameters:
string | Zend_Locale$locale
Exceptions:
Zend_Validate_ExceptionOn unrecognised region
Zend_Validate_ExceptionOn not detected format
Returns:
Zend_Validate_PostCode Provides fluid interface

Definition at line 124 of file PostCode.php.

Here is the call graph for this function:

Here is the caller graph for this function:


Field Documentation

$_format [protected]

Definition at line 63 of file PostCode.php.

$_locale [protected]

Definition at line 56 of file PostCode.php.

$_messageTemplates [protected]
Initial value:
 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.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations