Public Member Functions | Data Fields | Protected Attributes

Zend_Validate_InArray Class Reference

Inheritance diagram for Zend_Validate_InArray:
Zend_Validate_Abstract Zend_Validate_Interface

Public Member Functions

 __construct (array $haystack, $strict=false)
 getHaystack ()
 setHaystack (array $haystack)
 getStrict ()
 setStrict ($strict)
 isValid ($value)

Data Fields

const NOT_IN_ARRAY = 'notInArray'

Protected Attributes

 $_messageTemplates
 $_haystack
 $_strict

Detailed Description

Definition at line 36 of file InArray.php.


Constructor & Destructor Documentation

__construct ( array $  haystack,
strict = false 
)

Sets validator options

Parameters:
array$haystack
boolean$strict
Returns:
void

Definition at line 69 of file InArray.php.


Member Function Documentation

getHaystack (  )

Returns the haystack option

Returns:
mixed

Definition at line 80 of file InArray.php.

getStrict (  )

Returns the strict option

Returns:
boolean

Definition at line 102 of file InArray.php.

isValid ( value )

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:
mixed$value
Returns:
boolean

Implements Zend_Validate_Interface.

Definition at line 128 of file InArray.php.

setHaystack ( array $  haystack )

Sets the haystack option

Parameters:
mixed$haystack
Returns:
Zend_Validate_InArray Provides a fluent interface

Definition at line 91 of file InArray.php.

setStrict ( strict )

Sets the strict option

Parameters:
boolean$strict
Returns:
Zend_Validate_InArray Provides a fluent interface

Definition at line 113 of file InArray.php.


Field Documentation

$_messageTemplates [protected]
Initial value:
 array(
        self::NOT_IN_ARRAY => "'%value%' was not found in the haystack"
    )

Reimplemented from Zend_Validate_Abstract.

Definition at line 44 of file InArray.php.


The documentation for this class was generated from the following file: