You are here

public function EmbedButton::getTypeLabel in Embed 8

Returns the label of the associated embed type.

Return value

string Human readable label of the embed type.

Overrides EmbedButtonInterface::getTypeLabel

File

src/Entity/EmbedButton.php, line 97

Class

EmbedButton
Defines the EmbedButton entity.

Namespace

Drupal\embed\Entity

Code

public function getTypeLabel() {
  if ($definition = $this
    ->embedTypeManager()
    ->getDefinition($this
    ->getTypeId(), FALSE)) {
    return $definition['label'];
  }
  return $this
    ->t('Unknown');
}