You are here

public function NamespacedAttributeBag::has in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-foundation/Session/Attribute/NamespacedAttributeBag.php \Symfony\Component\HttpFoundation\Session\Attribute\NamespacedAttributeBag::has()

Checks if an attribute is defined.

Parameters

string $name The attribute name:

Return value

bool true if the attribute is defined, false otherwise

Overrides AttributeBag::has

File

vendor/symfony/http-foundation/Session/Attribute/NamespacedAttributeBag.php, line 44

Class

NamespacedAttributeBag
This class provides structured storage of session attributes using a name spacing character in the key.

Namespace

Symfony\Component\HttpFoundation\Session\Attribute

Code

public function has($name) {

  // reference mismatch: if fixed, re-introduced in array_key_exists; keep as it is
  $attributes = $this
    ->resolveAttributePath($name);
  $name = $this
    ->resolveKey($name);
  if (null === $attributes) {
    return false;
  }
  return array_key_exists($name, $attributes);
}