You are here

public function LayoutSectionItem::__get in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/layout_builder/src/Plugin/Field/FieldType/LayoutSectionItem.php \Drupal\layout_builder\Plugin\Field\FieldType\LayoutSectionItem::__get()
  2. 9 core/modules/layout_builder/src/Plugin/Field/FieldType/LayoutSectionItem.php \Drupal\layout_builder\Plugin\Field\FieldType\LayoutSectionItem::__get()

Magic method: Gets a property value.

Parameters

string $property_name: The name of the property to get; e.g., 'title' or 'name'.

Return value

mixed The property value.

Throws

\InvalidArgumentException If a non-existent property is accessed.

Overrides FieldItemBase::__get

File

core/modules/layout_builder/src/Plugin/Field/FieldType/LayoutSectionItem.php, line 45

Class

LayoutSectionItem
Plugin implementation of the 'layout_section' field type.

Namespace

Drupal\layout_builder\Plugin\Field\FieldType

Code

public function __get($name) {

  // @todo \Drupal\Core\Field\FieldItemBase::__get() does not return default
  //   values for uninstantiated properties. This will forcibly instantiate
  //   all properties with the side-effect of a performance hit, resolve
  //   properly in https://www.drupal.org/node/2413471.
  $this
    ->getProperties();
  return parent::__get($name);
}