You are here

public function EmbedTypeBase::getConfigurationValue in Embed 8

Gets a configuration value.

Parameters

string $name: The name of the plugin configuration value.

mixed $default: The default value to return if the configuration value does not exist.

Return value

mixed The currently set configuration value, or the value of $default if the configuration value is not set.

Overrides EmbedTypeInterface::getConfigurationValue

2 calls to EmbedTypeBase::getConfigurationValue()
Aircraft::buildConfigurationForm in tests/embed_test/src/Plugin/EmbedType/Aircraft.php
Form constructor.
Animal::buildConfigurationForm in tests/embed_test/src/Plugin/EmbedType/Animal.php
Form constructor.

File

src/EmbedType/EmbedTypeBase.php, line 48

Class

EmbedTypeBase
Defines a base implementation that most embed type plugins will extend.

Namespace

Drupal\embed\EmbedType

Code

public function getConfigurationValue($name, $default = NULL) {
  $configuration = $this
    ->getConfiguration();
  if (array_key_exists($name, $configuration)) {
    return $configuration[$name];
  }
  else {
    return $default;
  }
}