You are here

public function CclService::getCachedLinks in Custom Contextual Links 8.2

Helper function to retrieve cached links and generate them if not set.

Parameters

string $type: The id of the cache type.

Return value

array The cached link data.

File

src/CclService.php, line 65

Class

CclService
Class CclService.

Namespace

Drupal\ccl

Code

public function getCachedLinks($type) {
  $cachedLinks = $this->cache
    ->get($type);
  if (!isset($cachedLinks->cid)) {
    $this->eventDispatcher
      ->dispatch('ccl_update_cache');
    $cachedLinks = $this->cache
      ->get($type);
  }
  return $cachedLinks->data;
}