function MapItem::toArray

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Field/Plugin/Field/FieldType/MapItem.php \Drupal\Core\Field\Plugin\Field\FieldType\MapItem::toArray()
  2. 10 core/lib/Drupal/Core/Field/Plugin/Field/FieldType/MapItem.php \Drupal\Core\Field\Plugin\Field\FieldType\MapItem::toArray()
  3. 11.x core/lib/Drupal/Core/Field/Plugin/Field/FieldType/MapItem.php \Drupal\Core\Field\Plugin\Field\FieldType\MapItem::toArray()

Overrides Map::toArray

File

core/lib/Drupal/Core/Field/Plugin/Field/FieldType/MapItem.php, line 47

Class

MapItem
Defines the 'map' entity field type.

Namespace

Drupal\Core\Field\Plugin\Field\FieldType

Code

public function toArray() {
    // The default implementation of toArray() only returns known properties.
    // For a map, return everything as the properties are not pre-defined.
    return $this->getValue();
}

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