interface DefinitionDiscoveryInterface in Libraries API 8.3
Provides an interface for library definition discoveries.
This is similar to the plugin system's DiscoveryInterface, except that this does not require knowing all definitions upfront, so there is no getDefinitions() method.
Hierarchy
- interface \Drupal\libraries\ExternalLibrary\Definition\DefinitionDiscoveryInterface
Expanded class hierarchy of DefinitionDiscoveryInterface
All classes that implement DefinitionDiscoveryInterface
See also
\Drupal\Component\Plugin\Discovery\DiscoveryInterface
Related topics
1 file declares its use of DefinitionDiscoveryInterface
- LibraryManager.php in src/
ExternalLibrary/ LibraryManager.php
1 string reference to 'DefinitionDiscoveryInterface'
1 service uses DefinitionDiscoveryInterface
File
- src/
ExternalLibrary/ Definition/ DefinitionDiscoveryInterface.php, line 16
Namespace
Drupal\libraries\ExternalLibrary\DefinitionView source
interface DefinitionDiscoveryInterface {
/**
* Checks whether a library definition exists.
*
* @param string $id
* The library ID.
*
* @return bool
* TRUE if a library definition with the given ID exists; FALSE otherwise.
*/
public function hasDefinition($id);
/**
* Gets a library definition by its ID.
*
* @param string $id
* The library ID.
*
* @return array
* The library definition.
*
* @throws \Drupal\libraries\ExternalLibrary\Exception\LibraryDefinitionNotFoundException
*
* @todo Consider returning a classed object instead of an array or at least
* document and validate the array structure.
*/
public function getDefinition($id);
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DefinitionDiscoveryInterface:: |
public | function | Gets a library definition by its ID. | 2 |
DefinitionDiscoveryInterface:: |
public | function | Checks whether a library definition exists. | 3 |