You are here

public function ItemList::getValue in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/TypedData/Plugin/DataType/ItemList.php \Drupal\Core\TypedData\Plugin\DataType\ItemList::getValue()
  2. 10 core/lib/Drupal/Core/TypedData/Plugin/DataType/ItemList.php \Drupal\Core\TypedData\Plugin\DataType\ItemList::getValue()

Gets the data value.

Return value

mixed The data value.

Overrides TypedData::getValue

4 calls to ItemList::getValue()
FieldItemList::defaultValuesFormSubmit in core/lib/Drupal/Core/Field/FieldItemList.php
Processes the submitted default value.
FieldItemList::equals in core/lib/Drupal/Core/Field/FieldItemList.php
Determines equality to another object implementing FieldItemListInterface.
LayoutSectionItemList::getEntity in core/modules/layout_builder/src/Field/LayoutSectionItemList.php
Gets the entity that field belongs to.
MapFieldItemList::equals in core/lib/Drupal/Core/Field/MapFieldItemList.php
Determines equality to another object implementing FieldItemListInterface.

File

core/lib/Drupal/Core/TypedData/Plugin/DataType/ItemList.php, line 38

Class

ItemList
A generic list class.

Namespace

Drupal\Core\TypedData\Plugin\DataType

Code

public function getValue() {
  $values = [];
  foreach ($this->list as $delta => $item) {
    $values[$delta] = $item
      ->getValue();
  }
  return $values;
}