public function ItemList::appendItem in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/TypedData/Plugin/DataType/ItemList.php \Drupal\Core\TypedData\Plugin\DataType\ItemList::appendItem()
Appends a new item to the list.
Parameters
mixed $value: The value of the new item.
Return value
\Drupal\Core\TypedData\TypedDataInterface The item that was appended.
Overrides ListInterface::appendItem
5 calls to ItemList::appendItem()
- CommentFieldItemList::get in core/
modules/ comment/ src/ CommentFieldItemList.php - Returns the item at the specified position in this list.
- FieldItemList::applyDefaultValue in core/
lib/ Drupal/ Core/ Field/ FieldItemList.php - Applies the default value.
- FieldItemList::__set in core/
lib/ Drupal/ Core/ Field/ FieldItemList.php - Magic method: Sets a property value of the first field item.
- ItemList::offsetSet in core/
lib/ Drupal/ Core/ TypedData/ Plugin/ DataType/ ItemList.php - ItemList::set in core/
lib/ Drupal/ Core/ TypedData/ Plugin/ DataType/ ItemList.php - Sets the value of the item at a given position in the list.
File
- core/
lib/ Drupal/ Core/ TypedData/ Plugin/ DataType/ ItemList.php, line 212 - Contains \Drupal\Core\TypedData\Plugin\DataType\ItemList.
Class
- ItemList
- A generic list class.
Namespace
Drupal\Core\TypedData\Plugin\DataTypeCode
public function appendItem($value = NULL) {
$offset = count($this->list);
$item = $this
->createItem($offset, $value);
$this->list[$offset] = $item;
return $item;
}