You are here

public function UltimenuTool::getShortenedUuid in Ultimenu 8.2

Gets the shortened UUID.

Parameters

string $key: The menu item key with UUID.

Return value

string The shortened UUID.

Overrides UltimenuToolInterface::getShortenedUuid

1 call to UltimenuTool::getShortenedUuid()
UltimenuTool::getRegionKey in src/UltimenuTool.php
Gets the region key.

File

src/UltimenuTool.php, line 118

Class

UltimenuTool
Provides Ultimenu utility methods.

Namespace

Drupal\ultimenu

Code

public function getShortenedUuid($key) {
  list(, $uuid) = array_pad(array_map('trim', explode(":", $key, 2)), 2, NULL);
  $uuid = str_replace('.', '__', $uuid ?: $key);
  list($shortened_uuid, ) = array_pad(array_map('trim', explode("-", $uuid, 2)), 2, NULL);
  return $shortened_uuid;
}