You are here

public function Map::getValue in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/TypedData/Plugin/DataType/Map.php \Drupal\Core\TypedData\Plugin\DataType\Map::getValue()

Gets the data value.

Return value

mixed

Overrides TypedData::getValue

4 calls to Map::getValue()
EntityReferenceItem::getValue in core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php
Gets the data value.
MapItem::toArray in core/lib/Drupal/Core/Field/Plugin/Field/FieldType/MapItem.php
Returns an array of all property values.
ShapeItem::isEmpty in core/modules/system/tests/modules/entity_test/src/Plugin/Field/FieldType/ShapeItem.php
Determines whether the data structure is empty.
UriItem::isEmpty in core/lib/Drupal/Core/Field/Plugin/Field/FieldType/UriItem.php
Determines whether the data structure is empty.
1 method overrides Map::getValue()
EntityReferenceItem::getValue in core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php
Gets the data value.

File

core/lib/Drupal/Core/TypedData/Plugin/DataType/Map.php, line 58
Contains \Drupal\Core\TypedData\Plugin\DataType\Map.

Class

Map
The "map" data type.

Namespace

Drupal\Core\TypedData\Plugin\DataType

Code

public function getValue() {

  // Update the values and return them.
  foreach ($this->properties as $name => $property) {
    $definition = $property
      ->getDataDefinition();
    if (!$definition
      ->isComputed()) {
      $value = $property
        ->getValue();

      // Only write NULL values if the whole map is not NULL.
      if (isset($this->values) || isset($value)) {
        $this->values[$name] = $value;
      }
    }
  }
  return $this->values;
}