public ListInterface::set($index, $value)
Sets the value of the item at a given position in the list.
int $index: The position of the item in the list. Since a List only contains sequential, 0-based indexes, $index has to be:
item value.
indexes. This appends a new item with the provided value at the end of the list.
mixed $value: The value of the item to be stored at the specified position.
$this
\InvalidArgumentException If the $index is invalid (non-numeric, or pointing to an invalid position in the list).
\Drupal\Core\TypedData\Exception\MissingDataException If the complex data structure is unset and no item can be set.
public function set($index, $value);
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!TypedData!ListInterface.php/function/ListInterface::set/8.1.x