You are here

public function ExtensionList::get in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Extension/ExtensionList.php \Drupal\Core\Extension\ExtensionList::get()

Returns a single extension.

Parameters

string $extension_name: The machine name of the extension.

Return value

\Drupal\Core\Extension\Extension A processed extension object for the extension with the specified machine name.

Throws

\Drupal\Core\Extension\Exception\UnknownExtensionException If there is no extension with the supplied name.

1 call to ExtensionList::get()
ExtensionList::checkIncompatibility in core/lib/Drupal/Core/Extension/ExtensionList.php
Tests the compatibility of an extension.

File

core/lib/Drupal/Core/Extension/ExtensionList.php, line 259

Class

ExtensionList
Provides available extensions.

Namespace

Drupal\Core\Extension

Code

public function get($extension_name) {
  $extensions = $this
    ->getList();
  if (isset($extensions[$extension_name])) {
    return $extensions[$extension_name];
  }
  throw new UnknownExtensionException("The {$this->type} {$extension_name} does not exist.");
}