equal
deleted
inserted
replaced
12 * obtain it through the world-wide-web, please send an email |
12 * obtain it through the world-wide-web, please send an email |
13 * to license@zend.com so we can send you a copy immediately. |
13 * to license@zend.com so we can send you a copy immediately. |
14 * |
14 * |
15 * @category Zend |
15 * @category Zend |
16 * @package Zend_Validate |
16 * @package Zend_Validate |
17 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
17 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
18 * @license http://framework.zend.com/license/new-bsd New BSD License |
18 * @license http://framework.zend.com/license/new-bsd New BSD License |
19 * @version $Id: PostCode.php 24593 2012-01-05 20:35:02Z matthew $ |
19 * @version $Id$ |
20 */ |
20 */ |
21 |
21 |
22 /** |
22 /** |
23 * @see Zend_Validate_Abstract |
23 * @see Zend_Validate_Abstract |
24 */ |
24 */ |
30 require_once 'Zend/Locale/Format.php'; |
30 require_once 'Zend/Locale/Format.php'; |
31 |
31 |
32 /** |
32 /** |
33 * @category Zend |
33 * @category Zend |
34 * @package Zend_Validate |
34 * @package Zend_Validate |
35 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
35 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
36 * @license http://framework.zend.com/license/new-bsd New BSD License |
36 * @license http://framework.zend.com/license/new-bsd New BSD License |
37 */ |
37 */ |
38 class Zend_Validate_PostCode extends Zend_Validate_Abstract |
38 class Zend_Validate_PostCode extends Zend_Validate_Abstract |
39 { |
39 { |
40 const INVALID = 'postcodeInvalid'; |
40 const INVALID = 'postcodeInvalid'; |
117 * Sets the locale to use |
117 * Sets the locale to use |
118 * |
118 * |
119 * @param string|Zend_Locale $locale |
119 * @param string|Zend_Locale $locale |
120 * @throws Zend_Validate_Exception On unrecognised region |
120 * @throws Zend_Validate_Exception On unrecognised region |
121 * @throws Zend_Validate_Exception On not detected format |
121 * @throws Zend_Validate_Exception On not detected format |
122 * @return Zend_Validate_PostCode Provides fluid interface |
122 * @return Zend_Validate_PostCode Provides a fluent interface |
123 */ |
123 */ |
124 public function setLocale($locale = null) |
124 public function setLocale($locale = null) |
125 { |
125 { |
126 require_once 'Zend/Locale.php'; |
126 require_once 'Zend/Locale.php'; |
127 $this->_locale = Zend_Locale::findLocale($locale); |
127 $this->_locale = Zend_Locale::findLocale($locale); |
160 /** |
160 /** |
161 * Sets a self defined postal format as regex |
161 * Sets a self defined postal format as regex |
162 * |
162 * |
163 * @param string $format |
163 * @param string $format |
164 * @throws Zend_Validate_Exception On empty format |
164 * @throws Zend_Validate_Exception On empty format |
165 * @return Zend_Validate_PostCode Provides fluid interface |
165 * @return Zend_Validate_PostCode Provides a fluent interface |
166 */ |
166 */ |
167 public function setFormat($format) |
167 public function setFormat($format) |
168 { |
168 { |
169 if (empty($format) || !is_string($format)) { |
169 if (empty($format) || !is_string($format)) { |
170 require_once 'Zend/Validate/Exception.php'; |
170 require_once 'Zend/Validate/Exception.php'; |