You are here

public function DefaultPattern::getMachineName in Panels 8.3

Same name and namespace in other branches
  1. 8.4 src/Plugin/PanelsPattern/DefaultPattern.php \Drupal\panels\Plugin\PanelsPattern\DefaultPattern::getMachineName()

Gets the tempstore key identifier.

Parameters

array $cached_values:

Return value

string

Overrides PanelsPatternInterface::getMachineName

File

src/Plugin/PanelsPattern/DefaultPattern.php, line 58

Class

DefaultPattern
Plugin annotation @PanelsPattern("default");

Namespace

Drupal\panels\Plugin\PanelsPattern

Code

public function getMachineName($cached_values) {

  // PageManager needs special handling, so lets see if we're dealing with a PM page.
  if (isset($cached_values['page_variant'])) {
    return implode('--', [
      $cached_values['id'],
      $cached_values['page_variant']
        ->id(),
    ]);
  }
  return $cached_values['id'];
}