public function Map::get in Drupal 10
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/TypedData/Plugin/DataType/Map.php \Drupal\Core\TypedData\Plugin\DataType\Map::get()
- 9 core/lib/Drupal/Core/TypedData/Plugin/DataType/Map.php \Drupal\Core\TypedData\Plugin\DataType\Map::get()
Gets a property object.
Parameters
$property_name: The name of the property to get; e.g., 'title' or 'name'.
Return value
\Drupal\Core\TypedData\TypedDataInterface The property object.
Throws
\InvalidArgumentException If an invalid property name is given.
\Drupal\Core\TypedData\Exception\MissingDataException If the complex data structure is unset and no property can be created.
Overrides ComplexDataInterface::get
15 calls to Map::get()
- DateRangeItem::isEmpty in core/
modules/ datetime_range/ src/ Plugin/ Field/ FieldType/ DateRangeItem.php - Determines whether the data structure is empty.
- DateTimeItem::isEmpty in core/
modules/ datetime/ src/ Plugin/ Field/ FieldType/ DateTimeItem.php - Determines whether the data structure is empty.
- DummyAjaxItem::isEmpty in core/
modules/ image/ tests/ modules/ image_module_test/ src/ Plugin/ Field/ FieldType/ DummyAjaxItem.php - Determines whether the data structure is empty.
- EntityReferenceItem::onChange in core/
lib/ Drupal/ Core/ Field/ Plugin/ Field/ FieldType/ EntityReferenceItem.php - React to changes to a child property or item.
- EntityReferenceItem::setValue in core/
lib/ Drupal/ Core/ Field/ Plugin/ Field/ FieldType/ EntityReferenceItem.php - Overrides \Drupal\Core\TypedData\TypedData::setValue().
File
- core/
lib/ Drupal/ Core/ TypedData/ Plugin/ DataType/ Map.php, line 113
Class
- Map
- The "map" data type.
Namespace
Drupal\Core\TypedData\Plugin\DataTypeCode
public function get($property_name) {
if (!isset($this->properties[$property_name])) {
$value = NULL;
if (isset($this->values[$property_name])) {
$value = $this->values[$property_name];
}
// If the property is unknown, this will throw an exception.
$this->properties[$property_name] = $this
->getTypedDataManager()
->getPropertyInstance($this, $property_name, $value);
}
return $this->properties[$property_name];
}