Class Zend_Validate_PostCode

Description
  • copyright: Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  • license: New BSD License

Located in /Validate/PostCode.php (line 38)

Zend_Validate_Abstract
   |
   --Zend_Validate_PostCode
Class Constant Summary
 INVALID = 'postcodeInvalid'
 NO_MATCH = 'postcodeNoMatch'
Variable Summary
 unknown_type $_format
 string $_locale
Method Summary
 Zend_Validate_PostCode __construct ([string|Zend_Locale|array|Zend_Config $options = null])
 string getFormat ()
 boolean isValid (string $value)
 Zend_Validate_PostCode setFormat (string $format)
 Zend_Validate_PostCode setLocale ([string|Zend_Locale $locale = null])
Variables
unknown_type $_format (line 63)

Manual postal code format

  • access: protected
string $_locale (line 56)

Locale to use

  • access: protected
array $_messageTemplates = 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",
)
(line 46)
  • access: protected

Redefinition of:
Zend_Validate_Abstract::$_messageTemplates
Validation failure message template definitions

Inherited Variables

Inherited from Zend_Validate_Abstract

Zend_Validate_Abstract::$_defaultTranslator
Zend_Validate_Abstract::$_errors
Zend_Validate_Abstract::$_messageLength
Zend_Validate_Abstract::$_messages
Zend_Validate_Abstract::$_messageVariables
Zend_Validate_Abstract::$_obscureValue
Zend_Validate_Abstract::$_translator
Zend_Validate_Abstract::$_translatorDisabled
Zend_Validate_Abstract::$_value
Methods
Constructor __construct (line 74)

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

  • throws: Zend_Validate_Exception On empty format
  • access: public
Zend_Validate_PostCode __construct ([string|Zend_Locale|array|Zend_Config $options = null])
getFormat (line 155)

Returns the set postal code format

  • access: public
string getFormat ()
getLocale (line 111)

Returns the set locale

  • return: The set locale
  • access: public
string|Zend_Locale getLocale ()
isValid (line 194)

Defined by Zend_Validate_Interface

Returns true if and only if $value is a valid postalcode

  • access: public
boolean isValid (string $value)
  • string $value
setFormat (line 167)

Sets a self defined postal format as regex

  • return: Provides fluid interface
  • throws: Zend_Validate_Exception On empty format
  • access: public
Zend_Validate_PostCode setFormat (string $format)
  • string $format
setLocale (line 124)

Sets the locale to use

  • return: Provides fluid interface
  • throws: Zend_Validate_Exception On not detected format
  • throws: Zend_Validate_Exception On unrecognised region
  • access: public
Zend_Validate_PostCode setLocale ([string|Zend_Locale $locale = null])

Inherited Methods

Inherited From Zend_Validate_Abstract

 Zend_Validate_Abstract::getDefaultTranslator()
 Zend_Validate_Abstract::getErrors()
 Zend_Validate_Abstract::getMessageLength()
 Zend_Validate_Abstract::getMessages()
 Zend_Validate_Abstract::getMessageTemplates()
 Zend_Validate_Abstract::getMessageVariables()
 Zend_Validate_Abstract::getObscureValue()
 Zend_Validate_Abstract::getTranslator()
 Zend_Validate_Abstract::hasDefaultTranslator()
 Zend_Validate_Abstract::hasTranslator()
 Zend_Validate_Abstract::setDefaultTranslator()
 Zend_Validate_Abstract::setDisableTranslator()
 Zend_Validate_Abstract::setMessage()
 Zend_Validate_Abstract::setMessageLength()
 Zend_Validate_Abstract::setMessages()
 Zend_Validate_Abstract::setObscureValue()
 Zend_Validate_Abstract::setTranslator()
 Zend_Validate_Abstract::translatorIsDisabled()
 Zend_Validate_Abstract::_createMessage()
 Zend_Validate_Abstract::_error()
 Zend_Validate_Abstract::_setValue()
 Zend_Validate_Abstract::__get()
Class Constants
INVALID = 'postcodeInvalid' (line 40)
NO_MATCH = 'postcodeNoMatch' (line 41)

Documentation generated on Mon, 21 Jun 2010 15:39:21 -0400 by phpDocumentor 1.4.3