Definition at line 35 of file Iban.php.
◆ __construct()
__construct |
( |
|
$locale = null | ) |
|
Sets validator options
- Parameters
-
Definition at line 137 of file Iban.php.
140 $locale = $locale->toArray();
143 if (is_array($locale)) {
144 if (array_key_exists(
'locale', $locale)) {
145 $locale = $locale[
'locale'];
151 if (empty($locale)) {
152 #require_once 'Zend/Registry.php'; 158 if ($locale !==
null) {
static isRegistered($index)
◆ getLocale()
Returns the locale option
- Returns
- string|Zend_Locale|null
Definition at line 168 of file Iban.php.
◆ isValid()
Defined by Zend_Validate_Interface
Returns true if $value is a valid IBAN
- Parameters
-
- Returns
- boolean
Implements Zend_Validate_Interface.
Definition at line 204 of file Iban.php.
209 if (empty($this->_locale)) {
210 $region = substr(
$value, 0, 2);
213 $region = $region->getRegion();
216 if (!array_key_exists($region, $this->_ibanregex)) {
218 $this->
_error(self::NOTSUPPORTED);
222 if (!preg_match($this->_ibanregex[$region],
$value)) {
223 $this->
_error(self::FALSEFORMAT);
229 array(
'A',
'B',
'C',
'D',
'E',
'F',
'G',
'H',
'I',
'J',
'K',
'L',
'M',
230 'N',
'O',
'P',
'Q',
'R',
'S',
'T',
'U',
'V',
'W',
'X',
'Y',
'Z'),
231 array(
'10',
'11',
'12',
'13',
'14',
'15',
'16',
'17',
'18',
'19',
'20',
'21',
'22',
232 '23',
'24',
'25',
'26',
'27',
'28',
'29',
'30',
'31',
'32',
'33',
'34',
'35'),
235 $temp = intval(substr(
$format, 0, 1));
237 for ($x = 1; $x < $len; ++$x) {
239 $temp += intval(substr(
$format, $x, 1));
244 $this->
_error(self::CHECKFAILED);
_error($messageKey, $value=null)
◆ setLocale()
setLocale |
( |
|
$locale = null | ) |
|
Sets the locale option
- Parameters
-
- Exceptions
-
- Returns
- Zend_Validate_Date provides a fluent interface
Definition at line 181 of file Iban.php.
183 if ($locale !==
false) {
184 #require_once 'Zend/Locale.php'; 186 if (strlen($locale) < 4) {
187 #require_once 'Zend/Validate/Exception.php'; 192 $this->_locale = $locale;
static findLocale($locale=null)
◆ $_ibanregex
◆ $_locale
◆ $_messageTemplates
Initial value:= 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",
)
Definition at line 46 of file Iban.php.
◆ CHECKFAILED
const CHECKFAILED = 'ibanCheckFailed' |
◆ FALSEFORMAT
const FALSEFORMAT = 'ibanFalseFormat' |
◆ NOTSUPPORTED
const NOTSUPPORTED = 'ibanNotSupported' |
The documentation for this class was generated from the following file:
- vendor/magento/zendframework1/library/Zend/Validate/Iban.php