You are here

public function MapItem::__get in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Field/Plugin/Field/FieldType/MapItem.php \Drupal\Core\Field\Plugin\Field\FieldType\MapItem::__get()
  2. 9 core/lib/Drupal/Core/Field/Plugin/Field/FieldType/MapItem.php \Drupal\Core\Field\Plugin\Field\FieldType\MapItem::__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/lib/Drupal/Core/Field/Plugin/Field/FieldType/MapItem.php, line 82

Class

MapItem
Defines the 'map' entity field type.

Namespace

Drupal\Core\Field\Plugin\Field\FieldType

Code

public function __get($name) {
  if (!isset($this->values[$name])) {
    $this->values[$name] = [];
  }
  return $this->values[$name];
}