You are here

public function Element::__unset in Express 8

Magic unset method.

This is only for child elements, not properties.

Parameters

mixed $name: The name of the child element to unset.

Throws

\InvalidArgumentException Throws this error when the name is a property (key starting with #).

Overrides ArrayObject::__unset

File

themes/contrib/bootstrap/src/Utility/Element.php, line 133
Contains \Drupal\bootstrap\Utility\Element.

Class

Element
Provides helper methods for Drupal render elements.

Namespace

Drupal\bootstrap\Utility

Code

public function __unset($name) {
  if (\Drupal\Core\Render\Element::property($name)) {
    throw new \InvalidArgumentException('Cannot dynamically unset an element property. Use \\Drupal\\bootstrap\\Utility\\Element::hasProperty instead.');
  }
  parent::__unset($name);
}