You are here

public function NamespacedAttributeBag::remove in Zircon Profile 8.0

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

Removes an attribute.

Parameters

string $name:

Return value

mixed The removed value or null when it does not exist

Overrides AttributeBag::remove

File

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

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 remove($name) {
  $retval = null;
  $attributes =& $this
    ->resolveAttributePath($name);
  $name = $this
    ->resolveKey($name);
  if (null !== $attributes && array_key_exists($name, $attributes)) {
    $retval = $attributes[$name];
    unset($attributes[$name]);
  }
  return $retval;
}