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

Breadcrumb

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

function OpenerResolver::get

File

core/modules/media_library/src/OpenerResolver.php, line 39

Class

OpenerResolver
Defines a class to resolve media library openers.

Namespace

Drupal\media_library

Code

public function get(MediaLibraryState $state) {
    $service_id = $state->getOpenerId();
    $service = $this->openers[$service_id] ?? NULL;
    if ($service instanceof MediaLibraryOpenerInterface) {
        return $service;
    }
    throw new \RuntimeException("{$service_id} must be an instance of " . MediaLibraryOpenerInterface::class);
}

API Navigation

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