You are here

public function CdnBase::search in Libraries CDN API 8

Perform a search for a library.

Return value

array The resulting array.

Overrides CdnBaseInterface::search

File

src/CdnBase.php, line 135
Class CdnBase.

Class

CdnBase
Class CdnBase.

Namespace

Drupal\libraries_cdn

Code

public function search($library) {
  $this
    ->setLibrary($library);
  if (!$this
    ->isAvailable()) {
    return array();
  }
  $data = $this
    ->formatData(__FUNCTION__, $this
    ->query($this
    ->getURL(__FUNCTION__)));
  return array_map(function ($v) {
    return $v['name'];
  }, $data);
}