setHaystack($haystack); } } /** * * get haystack * * @return bool */ public function getHaystack() { return $this->_haystack; } /** * * set haystack * * @param array $haystack * @return \Cube\Validate\InArray */ public function setHaystack(array $haystack) { $this->_haystack = $haystack; return $this; } /** * * checks if the variable is contained in the haystack submitted * * @return bool return true if the validation is successful */ public function isValid() { if (!in_array($this->_value, $this->_haystack)) { return false; } return true; } }