Definition at line 33 of file Callback.php.
◆ __construct()
__construct |
( |
|
$callback = null | ) |
|
Sets validator options
- Parameters
-
- Exceptions
-
Definition at line 75 of file Callback.php.
77 if (is_callable($callback)) {
79 }
elseif (is_array($callback)) {
80 if (isset($callback[
'callback'])) {
83 if (isset($callback[
'options'])) {
88 if (
null === ($initializedCallack = $this->
getCallback())) {
89 #require_once 'Zend/Validate/Exception.php'; elseif(isset( $params[ 'redirect_parent']))
◆ getCallback()
Returns the set callback
- Returns
- mixed
Definition at line 99 of file Callback.php.
◆ getOptions()
Returns the set options for the callback
- Returns
- mixed
Definition at line 126 of file Callback.php.
◆ isValid()
Defined by Zend_Validate_Interface
Returns true if and only if the set callback returns for the provided $value
- Parameters
-
- Returns
- boolean
Implements Zend_Validate_Interface.
Definition at line 152 of file Callback.php.
158 $args = func_get_args();
162 if (!call_user_func_array($callback,
$options)) {
163 $this->
_error(self::INVALID_VALUE);
166 }
catch (Exception $e) {
167 $this->
_error(self::INVALID_CALLBACK);
_error($messageKey, $value=null)
◆ setCallback()
Sets the callback
- Parameters
-
- Exceptions
-
- Returns
- Zend_Validate_Callback Provides a fluent interface
Definition at line 111 of file Callback.php.
113 if (!is_callable($callback)) {
114 #require_once 'Zend/Validate/Exception.php'; 117 $this->_callback = $callback;
◆ setOptions()
◆ $_callback
◆ $_messageTemplates
Initial value:= array(
self::INVALID_VALUE => "'%value%' is not valid",
self::INVALID_CALLBACK => "An exception has been raised within the callback",
)
Definition at line 50 of file Callback.php.
◆ $_options
◆ INVALID_CALLBACK
const INVALID_CALLBACK = 'callbackInvalid' |
◆ INVALID_VALUE
const INVALID_VALUE = 'callbackValue' |
The documentation for this class was generated from the following file:
- vendor/magento/zendframework1/library/Zend/Validate/Callback.php