You are here

public function EmbedButton::getIconFile in Embed 8

Returns the button's icon file.

Return value

\Drupal\file\FileInterface The file entity of the button icon.

Overrides EmbedButtonInterface::getIconFile

Deprecated

in embed:8.x-1.2 and is removed from embed:2.0.0. Use \Drupal\embed\EmbedButtonInterface::getIconUrl() instead.

See also

https://www.drupal.org/project/embed/issues/3039598

File

src/Entity/EmbedButton.php, line 116

Class

EmbedButton
Defines the EmbedButton entity.

Namespace

Drupal\embed\Entity

Code

public function getIconFile() {
  @trigger_error(__METHOD__ . ' is deprecated in embed:8.x-1.2 and will be removed in embed:2.0.0. Use \\Drupal\\embed\\Entity\\EmbedButton::getIconUrl instead. See https://www.drupal.org/node/3139211', E_USER_DEPRECATED);
  if (!empty($this->icon_uuid)) {
    $files = $this
      ->entityTypeManager()
      ->getStorage('file')
      ->loadByProperties([
      'uuid' => $this->icon_uuid,
    ]);
    return reset($files);
  }
}