Add last() function to ItemInterface/ItemList

Created on 30 January 2024, 11 months ago
Updated 31 January 2024, 11 months ago

Problem/Motivation

There is a first() method in Drupal/Core/TypedData/Plugin/DataType/ItemList.php but no last(), which seem to be a pretty standard and easy method to implement.

Proposed resolution

Something like:

public function last() {
  return $this->get($this->count() - 1);
}

Remaining tasks

  • Add new method
  • Write Test coverage
  • Write Documentation
  • Write Release note
โœจ Feature request
Status

Active

Version

11.0 ๐Ÿ”ฅ

Component
Typed dataย  โ†’

Last updated 16 days ago

  • Maintained by
  • ๐Ÿ‡ฆ๐Ÿ‡นAustria @fago
Created by

๐Ÿ‡ฉ๐Ÿ‡ฐDenmark nicklasmf

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024