function ItemList::offsetSet

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/TypedData/Plugin/DataType/ItemList.php \Drupal\Core\TypedData\Plugin\DataType\ItemList::offsetSet()
  2. 8.9.x core/lib/Drupal/Core/TypedData/Plugin/DataType/ItemList.php \Drupal\Core\TypedData\Plugin\DataType\ItemList::offsetSet()
  3. 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 195

Class

ItemList
A generic list class.

Namespace

Drupal\Core\TypedData\Plugin\DataType

Code

public function offsetSet($offset, $value) : void {
    if (!isset($offset)) {
        // The [] operator has been used.
        $this->appendItem($value);
    }
    else {
        $this->set($offset, $value);
    }
}

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