You are here

public function ChainLocator::locate in Libraries API 8.3

Locates a library.

Parameters

\Drupal\libraries\ExternalLibrary\Local\LocalLibraryInterface $library: The library to locate.

Overrides LocatorInterface::locate

See also

\Drupal\libraries\ExternalLibrary\Local\LocatorInterface::locate()

File

src/Plugin/libraries/Locator/ChainLocator.php, line 43

Class

ChainLocator
Provides a locator utilizing a chain of other individual locators.

Namespace

Drupal\libraries\Plugin\libraries\Locator

Code

public function locate(LocalLibraryInterface $library) {
  foreach ($this->locators as $locator) {
    $locator
      ->locate($library);
    if ($library
      ->isInstalled()) {
      return;
    }
  }
  $library
    ->setUninstalled();
}