You are here

public function KeyInputBase::processExistingKeyValue in Key 8

Process an existing key value.

Parameters

string $key_value: The existing key value.

Return value

string The processed key value.

Overrides KeyInputInterface::processExistingKeyValue

1 method overrides KeyInputBase::processExistingKeyValue()
NoneKeyInput::processExistingKeyValue in src/Plugin/KeyInput/NoneKeyInput.php
Process an existing key value.

File

src/Plugin/KeyInputBase.php, line 68

Class

KeyInputBase
Defines a base class for Key Type plugins.

Namespace

Drupal\key\Plugin

Code

public function processExistingKeyValue($key_value) {

  // This is the default behavior. The key value is Base64-encoded if
  // it was originally submitted with Base64 encoding. Otherwise, it is
  // returned as-is.
  if (isset($this->configuration['base64_encoded']) && $this->configuration['base64_encoded'] == TRUE) {
    $processed_value = base64_encode($key_value);
  }
  else {
    $processed_value = $key_value;
  }
  return $processed_value;
}