You are here

public function ItemList::offsetSet 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::offsetSet()
  2. 10 core/lib/Drupal/Core/TypedData/Plugin/DataType/ItemList.php \Drupal\Core\TypedData\Plugin\DataType\ItemList::offsetSet()

File

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

Class

ItemList
A generic list class.

Namespace

Drupal\Core\TypedData\Plugin\DataType

Code

public function offsetSet($offset, $value) {
  if (!isset($offset)) {

    // The [] operator has been used.
    $this
      ->appendItem($value);
  }
  else {
    $this
      ->set($offset, $value);
  }
}