public function NamespacedAttributeBag::has

Checks if an attribute is defined.

Parameters

string $name The attribute name:

Return value

Boolean true if the attribute is defined, false otherwise

Overrides AttributeBag::has

File

drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/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) {
  $attributes = $this
    ->resolveAttributePath($name);
  $name = $this
    ->resolveKey($name);
  if (null === $attributes) {
    return false;
  }
  return array_key_exists($name, $attributes);
}