You are here

protected function LocalRemoteAssetTrait::canBeAttached in Libraries API 8.3

Checks whether this library can be attached.

Return value

bool TRUE if the library can be attached; FALSE otherwise.

See also

\Drupal\libraries\ExternalLibrary\Asset\SingleAssetLibraryTrait::canBeAttached()

File

src/ExternalLibrary/Asset/LocalRemoteAssetTrait.php, line 27

Class

LocalRemoteAssetTrait
A trait for asset libraries that serve local and remote files.

Namespace

Drupal\libraries\ExternalLibrary\Asset

Code

protected function canBeAttached() {

  /** @var \Drupal\libraries\ExternalLibrary\Local\LocalLibraryInterface|\Drupal\libraries\ExternalLibrary\Remote\RemoteLibraryInterface $this */
  return $this
    ->isInstalled() || $this
    ->hasRemoteUrl();
}