You are here

public function Key::getKeyValues in Key 8

Gets the values of the key.

Return value

array The values of the key.

Overrides KeyInterface::getKeyValues

File

src/Entity/Key.php, line 276

Class

Key
Defines the Key entity.

Namespace

Drupal\key\Entity

Code

public function getKeyValues($reset = FALSE) {
  $value = $this
    ->getKeyValue($reset);
  $key_type = $this
    ->getKeyType();
  if ($key_type
    ->getPluginDefinition()['multivalue']['enabled']) {
    $values = $key_type
      ->unserialize($value);
  }
  else {
    $values = (array) $value;
  }
  return $values;
}