You are here

public function EntityEmbedDisplayBase::getAttributeValue in Entity Embed 8

Gets the value for an attribute.

Parameters

string $name: The name of the attribute.

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

Return value

mixed The currently set attribute value.

2 calls to EntityEmbedDisplayBase::getAttributeValue()
EntityEmbedDisplayBase::getLangcode in src/EntityEmbedDisplay/EntityEmbedDisplayBase.php
Gets the current language code.
ImageFieldFormatter::buildConfigurationForm in src/Plugin/entity_embed/EntityEmbedDisplay/ImageFieldFormatter.php
Form constructor.

File

src/EntityEmbedDisplay/EntityEmbedDisplayBase.php, line 321

Class

EntityEmbedDisplayBase
Defines a base Entity Embed Display implementation.

Namespace

Drupal\entity_embed\EntityEmbedDisplay

Code

public function getAttributeValue($name, $default = NULL) {
  $attributes = $this
    ->getAttributeValues();
  return array_key_exists($name, $attributes) ? $attributes[$name] : $default;
}