function ItemList::last
Same name and namespace in other branches
- 11.x core/lib/Drupal/Core/TypedData/Plugin/DataType/ItemList.php \Drupal\Core\TypedData\Plugin\DataType\ItemList::last()
Returns the last item in this list.
@phpstan-return ?T
Return value
\Drupal\Core\TypedData\TypedDataInterface|null The last item in this list, or NULL if there are no items.
Overrides ListInterface::last
File
-
core/
lib/ Drupal/ Core/ TypedData/ Plugin/ DataType/ ItemList.php, line 317
Class
- ItemList
- A generic list class.
Namespace
Drupal\Core\TypedData\Plugin\DataTypeCode
public function last() : ?TypedDataInterface {
return $this->get($this->count() - 1);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.