You are here

interface LibraryManagerInterface in Libraries API 8.3

Provides an interface for external library managers.

Hierarchy

Expanded class hierarchy of LibraryManagerInterface

All classes that implement LibraryManagerInterface

7 files declare their use of LibraryManagerInterface
AssetLibrary.php in src/ExternalLibrary/Asset/AssetLibrary.php
AssetLibraryInterface.php in src/ExternalLibrary/Asset/AssetLibraryInterface.php
AssetLibraryType.php in src/Plugin/libraries/Type/AssetLibraryType.php
AttachableAssetLibraryRegistrationInterface.php in src/ExternalLibrary/Asset/AttachableAssetLibraryRegistrationInterface.php
MultipleAssetLibrary.php in src/ExternalLibrary/Asset/MultipleAssetLibrary.php

... See full list

File

src/ExternalLibrary/LibraryManagerInterface.php, line 8

Namespace

Drupal\libraries\ExternalLibrary
View source
interface LibraryManagerInterface {

  /**
   * Gets a library by its ID.
   *
   * @param string $id
   *   The library ID.
   *
   * @return \Drupal\libraries\ExternalLibrary\LibraryInterface
   *   The library object.
   *
   * @throws \Drupal\libraries\ExternalLibrary\Exception\LibraryDefinitionNotFoundException
   * @throws \Drupal\libraries\ExternalLibrary\Exception\LibraryTypeNotFoundException
   * @throws \Drupal\Component\Plugin\Exception\PluginException
   */
  public function getLibrary($id);

  /**
   * Gets the list of libraries that are required by enabled extensions.
   *
   * Modules, themes, and installation profiles can declare library dependencies
   * by specifying a 'library_dependencies' key in their info files.
   *
   * @return string[]
   *   An array of library IDs.
   */
  public function getRequiredLibraryIds();

  /**
   * Loads library files for a library.
   *
   * Note that not all library types support explicit loading. Asset libraries,
   * in particular, are declared to Drupal core's library system and are then
   * loaded using that.
   *
   * @param string $id
   *   The ID of the library.
   *
   * @throws \Drupal\libraries\ExternalLibrary\Exception\LibraryDefinitionNotFoundException
   * @throws \Drupal\libraries\ExternalLibrary\Exception\LibraryNotInstalledException
   */
  public function load($id);

}

Members

Namesort descending Modifiers Type Description Overrides
LibraryManagerInterface::getLibrary public function Gets a library by its ID. 1
LibraryManagerInterface::getRequiredLibraryIds public function Gets the list of libraries that are required by enabled extensions. 1
LibraryManagerInterface::load public function Loads library files for a library. 1