You are here

class AssetLibraryType in Libraries API 8.3

Plugin annotation

@LibraryType("asset");

Hierarchy

Expanded class hierarchy of AssetLibraryType

File

src/Plugin/libraries/Type/AssetLibraryType.php, line 14

Namespace

Drupal\libraries\Plugin\libraries\Type
View source
class AssetLibraryType extends LibraryTypeBase implements AttachableAssetLibraryRegistrationInterface {

  /**
   * {@inheritdoc}
   */
  public function getLibraryClass() {
    return AssetLibrary::class;
  }

  /**
   * {@inheritdoc}
   */
  public function getAttachableAssetLibraries(LibraryInterface $library, LibraryManagerInterface $library_manager) {
    assert($library instanceof \Drupal\libraries\ExternalLibrary\Asset\AssetLibraryInterface);

    /** @var \Drupal\libraries\ExternalLibrary\Asset\AssetLibraryInterface $library */
    return [
      $library
        ->getId() => $library
        ->getAttachableAssetLibrary($library_manager),
    ];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AssetLibraryType::getAttachableAssetLibraries public function Reacts to the instantiation of a library. Overrides AttachableAssetLibraryRegistrationInterface::getAttachableAssetLibraries
AssetLibraryType::getLibraryClass public function Returns the class used for libraries of this type. Overrides LibraryTypeInterface::getLibraryClass
IdAccessorTrait::$id protected property The ID.
IdAccessorTrait::getId public function Returns the ID.
LibraryTypeBase::$detectorFactory protected property The version detector factory.
LibraryTypeBase::$locatorFactory protected property The locator factory.
LibraryTypeBase::create public static function Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface::create 1
LibraryTypeBase::onLibraryCreate public function Reacts to the instantiation of a library. Overrides LibraryCreationListenerInterface::onLibraryCreate
LibraryTypeBase::__construct public function Constructs the asset library type. 1