/** * Checks if a parameter exists * in the array * @param string $name * @return mixed */ protected function hasParameter($name) { if (isset($this->parameters[$name]) || array_key_exists($name, $this->parameters)) { return true; } try { return AgaviArrayPathDefinition::hasValue($name, $this->parameters); } catch (InvalidArgumentException $e) { return false; } }
/** * Indicates whether or not a Cookie exists. * * @param string A cookie name. * * @return bool True, if a cookie with that name exists, otherwise false. * * @author David Zülke <*****@*****.**> * @since 0.11.0 */ public function hasCookie($name) { if (isset($this->cookies[$name]) || array_key_exists($name, $this->cookies)) { return true; } try { return AgaviArrayPathDefinition::hasValue($name, $this->cookies); } catch (InvalidArgumentException $e) { return false; } }
/** * Indicates whether or not an attribute exists. * * @param string An attribute name. * @param string An attribute namespace. * * @return bool true, if the attribute exists, otherwise false. * * @author Sean Kerr <*****@*****.**> * @since 0.9.0 */ public function hasAttribute($name, $ns = null) { if ($ns === null) { $ns = $this->defaultNamespace; } if (isset($this->attributes[$ns])) { if (isset($this->attributes[$ns][$name]) || array_key_exists($name, $this->attributes[$ns])) { return true; } try { return AgaviArrayPathDefinition::hasValue($name, $this->attributes[$ns]); } catch (InvalidArgumentException $e) { return false; } } return false; }
/** * Checks if a value exists at the path of this instance in the given array. * * @param array The array to check. * * @author Dominik del Bondio <*****@*****.**> * @since 0.11.0 */ public function hasValue(array &$array) { return AgaviArrayPathDefinition::hasValue($this->parts, $array); }