Definition at line 33 of file InArray.php.
◆ __construct()
Sets validator options
- Parameters
-
- Exceptions
-
Definition at line 71 of file InArray.php.
76 #require_once 'Zend/Validate/Exception.php'; 82 $temp[
'haystack'] = func_get_arg(0);
83 $temp[
'strict'] = func_get_arg(1);
86 $temp = func_get_arg(0);
87 if (!array_key_exists(
'haystack',
$options)) {
97 if (array_key_exists(
'strict',
$options)) {
101 if (array_key_exists(
'recursive',
$options)) {
setHaystack(array $haystack)
◆ getHaystack()
Returns the haystack option
- Returns
- mixed
Definition at line 111 of file InArray.php.
◆ getRecursive()
Returns the recursive option
- Returns
- boolean
Definition at line 155 of file InArray.php.
◆ getStrict()
Returns the strict option
- Returns
- boolean
Definition at line 133 of file InArray.php.
◆ isValid()
Defined by Zend_Validate_Interface
Returns true if and only if $value is contained in the haystack option. If the strict option is true, then the type of $value is also checked.
- Parameters
-
- Returns
- boolean
Implements Zend_Validate_Interface.
Definition at line 181 of file InArray.php.
185 $iterator =
new RecursiveIteratorIterator(
new RecursiveArrayIterator($this->_haystack));
187 if ($this->_strict) {
196 if (in_array(
$value, $this->_haystack, $this->_strict)) {
201 $this->
_error(self::NOT_IN_ARRAY);
_error($messageKey, $value=null)
◆ setHaystack()
setHaystack |
( |
array |
$haystack | ) |
|
◆ setRecursive()
setRecursive |
( |
|
$recursive | ) |
|
Sets the recursive option
- Parameters
-
- Returns
- Zend_Validate_InArray Provides a fluent interface
Definition at line 166 of file InArray.php.
168 $this->_recursive = (boolean) $recursive;
◆ setStrict()
◆ $_haystack
◆ $_messageTemplates
Initial value:= array(
self::NOT_IN_ARRAY => "'%value%' was not found in the haystack",
)
Definition at line 40 of file InArray.php.
◆ $_recursive
◆ $_strict
◆ NOT_IN_ARRAY
const NOT_IN_ARRAY = 'notInArray' |
The documentation for this class was generated from the following file:
- vendor/magento/zendframework1/library/Zend/Validate/InArray.php