You are here

public function InstallablePluginManager::getDefinitionByLibraryId in Markdown 8.2

Retrieves a definition by library identifier.

Parameters

string $libraryId: The library identifier to match.

Return value

\Drupal\markdown\Annotation\InstallablePlugin|void The first plugin definition matching the first library identifier or NULL if not found.

Overrides InstallablePluginManagerInterface::getDefinitionByLibraryId

File

src/PluginManager/InstallablePluginManager.php, line 338

Class

InstallablePluginManager
Installable Plugin Manager.

Namespace

Drupal\markdown\PluginManager

Code

public function getDefinitionByLibraryId($libraryId) {
  foreach ($this
    ->getDefinitions() as $definition) {
    foreach ($definition->libraries as $library) {
      if ($library
        ->getId() === (string) $libraryId) {
        return $definition;
      }
    }
  }
}