function Map::getValue

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/TypedData/Plugin/DataType/Map.php \Drupal\Core\TypedData\Plugin\DataType\Map::getValue()
  2. 10 core/lib/Drupal/Core/TypedData/Plugin/DataType/Map.php \Drupal\Core\TypedData\Plugin\DataType\Map::getValue()
  3. 11.x core/lib/Drupal/Core/TypedData/Plugin/DataType/Map.php \Drupal\Core\TypedData\Plugin\DataType\Map::getValue()

Overrides TypedData::getValue

5 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.
MultiValueTestItem::isEmpty in core/modules/system/tests/modules/entity_test_update/src/Plugin/Field/FieldType/MultiValueTestItem.php
Determines whether the data structure is empty.
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 53

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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.