OXID eShop CE  4.8.12
 All Classes Files Functions Variables Pages
oxsepavalidator.php
Go to the documentation of this file.
1 <?php
2 
8 {
12  protected $_aIBANCodeLengths = array(
13  'AL' => 28,
14  'AD' => 24,
15  'AT' => 20,
16  'AZ' => 28,
17  'BH' => 22,
18  'BE' => 16,
19  'BA' => 20,
20  'BR' => 29,
21  'BG' => 22,
22  'CR' => 21,
23  'HR' => 21,
24  'CY' => 28,
25  'CZ' => 24,
26  'DK' => 18, // Same DENMARK
27  'FO' => 18, // Same DENMARK
28  'GL' => 18, // Same DENMARK
29  'DO' => 28,
30  'EE' => 20,
31  'FI' => 18,
32  'FR' => 27,
33  'GE' => 22,
34  'DE' => 22,
35  'GI' => 23,
36  'GR' => 27,
37  'GT' => 28,
38  'HU' => 28,
39  'IS' => 26,
40  'IE' => 22,
41  'IL' => 23,
42  'IT' => 27,
43  'KZ' => 20,
44  'KW' => 30,
45  'LV' => 21,
46  'LB' => 28,
47  'LI' => 21,
48  'LT' => 20,
49  'LU' => 20,
50  'MK' => 19,
51  'MT' => 31,
52  'MR' => 27,
53  'MU' => 30,
54  'MD' => 24,
55  'MC' => 27,
56  'ME' => 22,
57  'NL' => 18,
58  'NO' => 15,
59  'PK' => 24,
60  'PS' => 29,
61  'PL' => 28,
62  'PT' => 25,
63  'RO' => 24,
64  'SM' => 27,
65  'SA' => 24,
66  'RS' => 22,
67  'SK' => 24,
68  'SI' => 19,
69  'ES' => 24,
70  'SE' => 24,
71  'CH' => 21,
72  'TN' => 24,
73  'TR' => 26,
74  'AE' => 23,
75  'GB' => 22,
76  'VG' => 24
77  );
78 
86  public function isValidBIC( $sBIC )
87  {
88  $oBICValidator = oxNew( 'oxSepaBICValidator' );
89 
90  return $oBICValidator->isValid( $sBIC );
91  }
92 
100  public function isValidIBAN( $sIBAN )
101  {
102  $oIBANValidator = oxNew( 'oxSepaIBANValidator' );
103  $oIBANValidator->setCodeLengths( $this->getIBANCodeLengths() );
104 
105  return $oIBANValidator->isValid( $sIBAN );
106  }
107 
116  public function isValidIBANRegistry( $aIBANRegistry = null )
117  {
118  $oIBANValidator = oxNew( 'oxSepaIBANValidator' );
119 
120  if ( is_null( $aIBANRegistry ) ) {
121  $aIBANRegistry = $this->getIBANCodeLengths();
122  }
123 
124  return $oIBANValidator->isCodeLengthsValid( $aIBANRegistry );
125  }
126 
127 
136  public function setIBANRegistry( $aIBANRegistry )
137  {
138  if ( $this->isValidIBANRegistry( $aIBANRegistry ) ) {
139  $this->_aIBANCodeLengths = $aIBANRegistry;
140 
141  return true;
142  } else {
143  return false;
144  }
145  }
146 
153  public function getIBANRegistry()
154  {
156  }
157 
163  public function getIBANCodeLengths()
164  {
166  }
167 
168 
169 }