/** * Returns value if it is one of $allowed, FALSE otherwise. * * @param mixed $key * @return mixed */ public function isOneOf($key, $allowed = NULL) { return Zend_Filter::isOneOf($this->_source[$key], $allowed); }
/** * Returns value if it is one of $allowed, FALSE otherwise. * * @param mixed $key * @return mixed */ public function testOneOf($key, $allowed = NULL) { if (!$this->keyExists($key)) { return false; } if (Zend_Filter::isOneOf($this->_source[$key], $allowed)) { return $this->_source[$key]; } return FALSE; }
/** * Returns value if it is one of $allowed, FALSE otherwise. * * @param mixed $key * @return mixed */ public function testOneOf($key = null, $allowed = NULL) { if (!($value = $this->keyExists($key))) { return false; } if (Zend_Filter::isOneOf($value, $allowed)) { return $value; } return FALSE; }