Validates IBAN Numbers (International Bank Account Numbers)

category Zend
package Zend_Validate
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License
inherited_from \Zend_Validate_Abstract

 Methods

Sets validator options

__construct(string|\Zend_Config|\Zend_Locale $locale = null

Parameters

$locale

string\Zend_Config\Zend_Locale

OPTIONAL

Magic function returns the value of the requested property, if and only if it is the value or a message variable.

__get(string $property) : mixed
Inherited

Parameters

$property

string

Exceptions

\Zend_Validate_Exception

Returns

mixed

Get default translation object for all validate objects

getDefaultTranslator() : \Zend_Translate_Adapter | null
InheritedStatic

Returns

\Zend_Translate_Adapternull

Returns array of validation failure message codes

getErrors() : array
Inherited
deprecated Since 1.5.0

Returns

array

Returns the locale option

getLocale() : string | \Zend_Locale | null

Returns

string\Zend_Localenull

Returns the maximum allowed message length

getMessageLength() : integer
InheritedStatic

Returns

integer

Returns the message templates from the validator

getMessageTemplates() : array
Inherited

Returns

array

Returns an array of the names of variables that are used in constructing validation failure messages

getMessageVariables() : array
Inherited

Returns

array

Returns array of validation failure messages

getMessages() : array
Inherited

If isValid() was never called or if the most recent isValid() call returned true, then this method returns an empty array.

inherited_from \Zend_Validate_Interface::getMessages()

Returns

array

Retrieve flag indicating whether or not value should be obfuscated in messages

getObscureValue() : boolean
Inherited

Returns

boolean

Return translation object

getTranslator() : \Zend_Translate_Adapter | null
Inherited

Returns

\Zend_Translate_Adapternull

Is there a default translation object set?

hasDefaultTranslator() : boolean
InheritedStatic

Returns

boolean

Does this validator have its own specific translator?

hasTranslator() : boolean
Inherited

Returns

boolean

Defined by Zend_Validate_Interface

isValid(string $value) : boolean

Returns true if $value is a valid IBAN

Parameters

$value

string

Returns

boolean

Set default translation object for all validate objects

setDefaultTranslator(\Zend_Translate|\Zend_Translate_Adapter|null $translator = null
InheritedStatic

Parameters

$translator

\Zend_Translate\Zend_Translate_Adapternull

Exceptions

\Zend_Validate_Exception

Indicate whether or not translation should be disabled

setDisableTranslator(boolean $flag) : \Zend_Validate_Abstract
Inherited

Parameters

$flag

boolean

Returns

\Zend_Validate_Abstract

Sets the locale option

setLocale(string|\Zend_Locale $locale = null) : \Zend_Validate_Date

Parameters

$locale

string\Zend_Locale

Exceptions

\Zend_Locale_Exception
\Zend_Validate_Exception

Returns

\Zend_Validate_Dateprovides a fluent interface

Sets the validation failure message template for a particular key

setMessage(string $messageString, string $messageKey = null) : \Zend_Validate_Abstract
Inherited

Parameters

$messageString

string

$messageKey

string

OPTIONAL

Exceptions

\Zend_Validate_Exception

Returns

\Zend_Validate_AbstractProvides a fluent interface

Sets the maximum allowed message length

setMessageLength(integer $length = -1
InheritedStatic

Parameters

$length

integer

Sets validation failure message templates given as an array, where the array keys are the message keys, and the array values are the message template strings.

setMessages(array $messages) : \Zend_Validate_Abstract
Inherited

Parameters

$messages

array

Returns

\Zend_Validate_Abstract

Set flag indicating whether or not value should be obfuscated in messages

setObscureValue(boolean $flag) : \Zend_Validate_Abstract
Inherited

Parameters

$flag

boolean

Returns

\Zend_Validate_Abstract

Set translation object

setTranslator(\Zend_Translate|\Zend_Translate_Adapter|null $translator = null) : \Zend_Validate_Abstract
Inherited

Parameters

$translator

\Zend_Translate\Zend_Translate_Adapternull

Exceptions

\Zend_Validate_Exception

Returns

\Zend_Validate_Abstract

Is translation disabled?

translatorIsDisabled() : boolean
Inherited

Returns

boolean

Constructs and returns a validation failure message with the given message key and value.

_createMessage(string $messageKey, string $value) : string
Inherited

Returns null if and only if $messageKey does not correspond to an existing template.

If a translator is available and a translation exists for $messageKey, the translation will be used.

Parameters

$messageKey

string

$value

string

Returns

string

_error()

_error(string $messageKey, string $value = null) : void
Inherited

Parameters

$messageKey

string

$value

string

OPTIONAL

Joins elements of a multidimensional array

_implodeRecursive(array $pieces) : string
Inherited

Parameters

$pieces

array

Returns

string

Sets the value to be validated and clears the messages and errors arrays

_setValue(mixed $value) : void
Inherited

Parameters

$value

mixed

 Properties

 

Default translation object for all validate objects

$_defaultTranslator : \Zend_Translate

Default

Static
 

Array of validation failure message codes

$_errors : array

Default

array()
deprecated Since 1.5.0
 

IBAN regexes by region

$_ibanregex : array

Default

array('AD' => '/^AD[0-9]{2}[0-9]{8}[A-Z0-9]{12}$/', 'AE' => '/^AE[0-9]{2}[0-9]{3}[0-9]{16}$/', 'AL' => '/^AL[0-9]{2}[0-9]{8}[A-Z0-9]{16}$/', 'AT' => '/^AT[0-9]{2}[0-9]{5}[0-9]{11}$/', 'AZ' => '/^AZ[0-9]{2}[0-9]{4}[A-Z0-9]{20}$/', 'BA' => '/^BA[0-9]{2}[0-9]{6}[0-9]{10}$/', 'BE' => '/^BE[0-9]{2}[0-9]{3}[0-9]{9}$/', 'BG' => '/^BG[0-9]{2}[A-Z]{4}[0-9]{4}[0-9]{2}[A-Z0-9]{8}$/', 'BH' => '/^BH[0-9]{2}[A-Z]{4}[A-Z0-9]{14}$/', 'BR' => '/^BR[0-9]{2}[0-9]{8}[0-9]{5}[0-9]{10}[A-Z]{1}[A-Z0-9]{1}$/', 'CH' => '/^CH[0-9]{2}[0-9]{5}[A-Z0-9]{12}$/', 'CR' => '/^CR[0-9]{2}[0-9]{3}[0-9]{14}$/', 'CS' => '/^CS[0-9]{2}[0-9]{3}[0-9]{15}$/', 'CY' => '/^CY[0-9]{2}[0-9]{8}[A-Z0-9]{16}$/', 'CZ' => '/^CZ[0-9]{2}[0-9]{4}[0-9]{16}$/', 'DE' => '/^DE[0-9]{2}[0-9]{8}[0-9]{10}$/', 'DK' => '/^DK[0-9]{2}[0-9]{4}[0-9]{10}$/', 'DO' => '/^DO[0-9]{2}[A-Z0-9]{4}[0-9]{20}$/', 'EE' => '/^EE[0-9]{2}[0-9]{4}[0-9]{12}$/', 'ES' => '/^ES[0-9]{2}[0-9]{8}[0-9]{12}$/', 'FR' => '/^FR[0-9]{2}[0-9]{10}[A-Z0-9]{11}[0-9]{2}$/', 'FI' => '/^FI[0-9]{2}[0-9]{6}[0-9]{8}$/', 'FO' => '/^FO[0-9]{2}[0-9]{4}[0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-Z0-9]{10}[0-9]{2}$/', 'MR' => '/^MR13[0-9]{5}[0-9]{5}[0-9]{11}[0-9]{2}$/', 'MU' => '/^MU[0-9]{2}[A-Z]{4}[0-9]{2}[0-9]{2}[0-9]{12}[0-9]{3}[A-Z]{2}$/', 'MT' => '/^MT[0-9]{2}[A-Z]{4}[0-9]{5}[A-Z0-9]{18}$/', 'NL' => '/^NL[0-9]{2}[A-Z]{4}[0-9]{10}$/', 'NO' => '/^NO[0-9]{2}[0-9]{4}[0-9]{7}$/', 'PK' => '/^PK[0-9]{2}[A-Z]{4}[0-9]{16}$/', 'PL' => '/^PL[0-9]{2}[0-9]{8}[0-9]{16}$/', 'PS' => '/^PS[0-9]{2}[A-Z]{4}[0-9]{21}$/', 'PT' => '/^PT[0-9]{2}[0-9]{8}[0-9]{13}$/', 'RO' => '/^RO[0-9]{2}[A-Z]{4}[A-Z0-9]{16}$/', 'RS' => '/^RS[0-9]{2}[0-9]{3}[0-9]{13}[0-9]{2}$/', 'SA' => '/^SA[0-9]{2}[0-9]{2}[A-Z0-9]{18}$/', 'SE' => '/^SE[0-9]{2}[0-9]{3}[0-9]{17}$/', 'SI' => '/^SI[0-9]{2}[0-9]{5}[0-9]{8}[0-9]{2}$/', 'SK' => '/^SK[0-9]{2}[0-9]{4}[0-9]{16}$/', 'SM' => '/^SM[0-9]{2}[A-Z]{1}[0-9]{5}[0-9]{5}[A-Z0-9]{12}$/', 'TN' => '/^TN[0-9]{2}[0-9]{5}[0-9]{15}$/', 'TR' => '/^TR[0-9]{2}[0-9]{5}[A-Z0-9]{17}$/', 'VG' => '/^VG[0-9]{2}[A-Z]{4}[0-9]{16}$/')
 

Optional locale

$_locale : string | \Zend_Locale | null

Default

 

Limits the maximum returned length of a error message

$_messageLength : Integer

Default

-1
Static
 

Validation failure message template definitions

$_messageTemplates : array

Default

array(self::NOTSUPPORTED => "Unknown country within the IBAN '%value%'", self::FALSEFORMAT => "'%value%' has a false IBAN format", self::CHECKFAILED => "'%value%' has failed the IBAN check")
inherited_from \Zend_Validate_Abstract::_messageTemplates
 

Validation failure message template definitions

$_messageTemplates : array

Default

array()
 

Additional variables available for validation failure messages

$_messageVariables : array

Default

array()
 

Array of validation failure messages

$_messages : array

Default

array()
 

Flag indidcating whether or not value should be obfuscated in error messages

$_obscureValue : boolean

Default

false
 

Translation object

$_translator : \Zend_Translate

Default

 

Is translation disabled?

$_translatorDisabled : Boolean

Default

false
 

The value to be validated

$_value : mixed

Default

 Constants

 

CHECKFAILED

CHECKFAILED = 'ibanCheckFailed' 
 

FALSEFORMAT

FALSEFORMAT = 'ibanFalseFormat' 
 

NOTSUPPORTED

NOTSUPPORTED = 'ibanNotSupported'