public function Map::getValue

Overrides \Drupal\Core\TypedData\TypedData::getValue().

Overrides TypedData::getValue

File

drupal/core/lib/Drupal/Core/TypedData/Type/Map.php, line 56
Contains \Drupal\Core\TypedData\Type\Map.

Class

Map
The "map" data type.

Namespace

Drupal\Core\TypedData\Type

Code

public function getValue() {

  // Update the values and return them.
  foreach ($this->properties as $name => $property) {
    $definition = $property
      ->getDefinition();
    if (empty($definition['computed'])) {
      $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;
}