You are here

protected function EnvironmentVariablesKeyProvider::getEnvironmentVariables in Apigee Edge 8

Returns an array containing the environment variables by key type.

Parameters

\Drupal\key\KeyInterface $key: The key entity.

bool $required: Returns only the required environment variables.

Return value

array The environment variables.

3 calls to EnvironmentVariablesKeyProvider::getEnvironmentVariables()
EnvironmentVariablesKeyProvider::buildConfigurationForm in src/Plugin/KeyProvider/EnvironmentVariablesKeyProvider.php
Form constructor.
EnvironmentVariablesKeyProvider::checkRequirements in src/Plugin/KeyProvider/EnvironmentVariablesKeyProvider.php
Checks the requirements of the key provider.
EnvironmentVariablesKeyProvider::realGetKeyValue in src/Plugin/KeyProvider/EnvironmentVariablesKeyProvider.php
The method that returns a key's value after pre-requirements got validated.

File

src/Plugin/KeyProvider/EnvironmentVariablesKeyProvider.php, line 113

Class

EnvironmentVariablesKeyProvider
Stores Apigee Edge authentication credentials in environment variables.

Namespace

Drupal\apigee_edge\Plugin\KeyProvider

Code

protected function getEnvironmentVariables(KeyInterface $key, bool $required = FALSE) : array {
  $environment_variables = [];
  foreach ($key
    ->getKeyType()
    ->getPluginDefinition()['multivalue']['fields'] as $id => $field) {
    if ($required && isset($field['required']) && !$field['required']) {
      continue;
    }
    $environment_variables[$id] = 'APIGEE_EDGE_' . strtoupper($id);
  }
  return $environment_variables;
}