Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. CollectionInterface.php

function CollectionInterface::first

Returns the first item of the collection.

Return value

T

Throws

NoSuchElementException if this collection is empty.

1 method overrides CollectionInterface::first()
AbstractCollection::first in vendor/ramsey/collection/src/AbstractCollection.php

File

vendor/ramsey/collection/src/CollectionInterface.php, line 108

Class

CollectionInterface
A collection represents a group of values, known as its elements.

Namespace

Ramsey\Collection

Code

public function first() : mixed;

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal