public ArrayElement::get($name)
Gets a contained typed configuration element.
$name: The name of the property to get; e.g., 'title' or 'name'. Nested elements can be get using multiple dot delimited names, for example, 'page.front'.
\Drupal\Core\TypedData\TypedDataInterface The property object.
\InvalidArgumentException If an invalid property name is given.
Overrides TypedConfigInterface::get
public function get($name) { $parts = explode('.', $name); $root_key = array_shift($parts); $elements = $this->getElements(); if (isset($elements[$root_key])) { $element = $elements[$root_key]; // If $property_name contained a dot recurse into the keys. while ($element && ($key = array_shift($parts)) !== NULL) { if ($element instanceof TypedConfigInterface) { $element = $element->get($key); } else { $element = NULL; } } } if (isset($element)) { return $element; } else { throw new \InvalidArgumentException("The configuration property $name doesn't exist."); } }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Config!Schema!ArrayElement.php/function/ArrayElement::get/8.1.x