function Media::getDefaultThumbnailUri

Same name in other branches
  1. 9 core/modules/media/src/Entity/Media.php \Drupal\media\Entity\Media::getDefaultThumbnailUri()
  2. 10 core/modules/media/src/Entity/Media.php \Drupal\media\Entity\Media::getDefaultThumbnailUri()
  3. 11.x core/modules/media/src/Entity/Media.php \Drupal\media\Entity\Media::getDefaultThumbnailUri()

Returns the URI of the default thumbnail.

Return value

string The default thumbnail URI.

2 calls to Media::getDefaultThumbnailUri()
Media::getThumbnailUri in core/modules/media/src/Entity/Media.php
Gets the URI for the thumbnail of a media item.
Media::loadThumbnail in core/modules/media/src/Entity/Media.php
Loads the file entity for the thumbnail.

File

core/modules/media/src/Entity/Media.php, line 211

Class

Media
Defines the media entity class.

Namespace

Drupal\media\Entity

Code

protected function getDefaultThumbnailUri() {
    $default_thumbnail_filename = $this->getSource()
        ->getPluginDefinition()['default_thumbnail_filename'];
    return \Drupal::config('media.settings')->get('icon_base_uri') . '/' . $default_thumbnail_filename;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.