You are here

protected function GoogleAdwordsPathTrackerBackup::buildPathTree in Google AdWords Conversion Tracking 8

Retrieve the path tree from cache, or ask for it to be rebuild

Return value

array A path tree similar to a render tree, with an element per path argument

1 call to GoogleAdwordsPathTrackerBackup::buildPathTree()
GoogleAdwordsPathTrackerBackup::matchPath in modules/google_adwords_path/src/GoogleAdwordsPathTracker.backup.php

File

modules/google_adwords_path/src/GoogleAdwordsPathTracker.backup.php, line 192
Contains Drupal\google_adwords_path\GoogleAdwordsPathTracker.

Class

GoogleAdwordsPathTrackerBackup
Class GoogleAdwordsPathTracker.

Namespace

Drupal\google_adwords_path

Code

protected function buildPathTree() {

  /**
   * @var array|false $tree
   */
  $tree = $this->cache_data
    ->get(self::GOOGLE_ADWORDS_PATH_TREE_CACHE_CID);
  if ($tree === FALSE) {
    $tree = $this
      ->_buildPathTree();
    $this->cache_data
      ->set(self::GOOGLE_ADWORDS_PATH_TREE_CACHE_CID, $tree, CacheBackendInterface::CACHE_PERMANENT);
  }
  if (is_array($tree)) {
    return $tree;
  }
  else {
    return [];
  }
}