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

Breadcrumb

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

function MapInterface::get

Returns the value to which the specified key is mapped, `null` if this map contains no mapping for the key, or (optionally) `$defaultValue` if this map contains no mapping for the key.

Parameters

K $key The key to return from the map.:

T | null $defaultValue The default value to use if `$key` is not found.:

Return value

T | null the value or `null` if the key could not be found.

1 method overrides MapInterface::get()
AbstractMap::get in vendor/ramsey/collection/src/Map/AbstractMap.php

File

vendor/ramsey/collection/src/Map/MapInterface.php, line 63

Class

MapInterface
An object that maps keys to values.

Namespace

Ramsey\Collection\Map

Code

public function get(int|string $key, mixed $defaultValue = null) : mixed;

API Navigation

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