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: Callback.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 */ |
25 require_once 'Zend/Validate/Abstract.php'; |
25 require_once 'Zend/Validate/Abstract.php'; |
26 |
26 |
27 /** |
27 /** |
28 * @category Zend |
28 * @category Zend |
29 * @package Zend_Validate |
29 * @package Zend_Validate |
30 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
30 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
31 * @license http://framework.zend.com/license/new-bsd New BSD License |
31 * @license http://framework.zend.com/license/new-bsd New BSD License |
32 */ |
32 */ |
33 class Zend_Validate_Callback extends Zend_Validate_Abstract |
33 class Zend_Validate_Callback extends Zend_Validate_Abstract |
34 { |
34 { |
35 /** |
35 /** |
67 protected $_options = array(); |
67 protected $_options = array(); |
68 |
68 |
69 /** |
69 /** |
70 * Sets validator options |
70 * Sets validator options |
71 * |
71 * |
72 * @param string|array $callback |
72 * @param mixed $callback |
73 * @param mixed $max |
73 * @throws Zend_Validate_Exception |
74 * @param boolean $inclusive |
|
75 * @return void |
|
76 */ |
74 */ |
77 public function __construct($callback = null) |
75 public function __construct($callback = null) |
78 { |
76 { |
79 if (is_callable($callback)) { |
77 if (is_callable($callback)) { |
80 $this->setCallback($callback); |
78 $this->setCallback($callback); |
105 |
103 |
106 /** |
104 /** |
107 * Sets the callback |
105 * Sets the callback |
108 * |
106 * |
109 * @param string|array $callback |
107 * @param string|array $callback |
|
108 * @throws Zend_Validate_Exception |
110 * @return Zend_Validate_Callback Provides a fluent interface |
109 * @return Zend_Validate_Callback Provides a fluent interface |
111 */ |
110 */ |
112 public function setCallback($callback) |
111 public function setCallback($callback) |
113 { |
112 { |
114 if (!is_callable($callback)) { |
113 if (!is_callable($callback)) { |
130 } |
129 } |
131 |
130 |
132 /** |
131 /** |
133 * Sets options for the callback |
132 * Sets options for the callback |
134 * |
133 * |
135 * @param mixed $max |
134 * @param mixed $options |
136 * @return Zend_Validate_Callback Provides a fluent interface |
135 * @return Zend_Validate_Callback Provides a fluent interface |
137 */ |
136 */ |
138 public function setOptions($options) |
137 public function setOptions($options) |
139 { |
138 { |
140 $this->_options = (array) $options; |
139 $this->_options = (array) $options; |