You are here

public function ChainDefinitionDiscovery::hasDefinition in Libraries API 8.3

Checks whether a library definition exists.

Parameters

string $id: The library ID.

Return value

bool TRUE if a library definition with the given ID exists; FALSE otherwise.

Overrides DefinitionDiscoveryInterface::hasDefinition

File

src/ExternalLibrary/Definition/ChainDefinitionDiscovery.php, line 29

Class

ChainDefinitionDiscovery
Provides a definition discovery that checks a list of other discoveries.

Namespace

Drupal\libraries\ExternalLibrary\Definition

Code

public function hasDefinition($id) {
  foreach ($this->discoveries as $discovery) {
    if ($discovery
      ->hasDefinition($id)) {
      return TRUE;
    }
  }
  return FALSE;
}