You are here

protected function MediaPdfThumbnailImageManager::getGenericThumbnail in Media PDF Thumbnail 8.4

Return value

int|string|null

Throws

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException

\Drupal\Component\Plugin\Exception\PluginNotFoundException

1 call to MediaPdfThumbnailImageManager::getGenericThumbnail()
MediaPdfThumbnailImageManager::createThumbnail in src/Manager/MediaPdfThumbnailImageManager.php

File

src/Manager/MediaPdfThumbnailImageManager.php, line 132

Class

MediaPdfThumbnailImageManager
Class MediaPdfThumbnailImageManager.

Namespace

Drupal\media_pdf_thumbnail\Manager

Code

protected function getGenericThumbnail() {
  $uri = $this->configFactory
    ->get('media.settings')
    ->get('icon_base_uri');
  $files = $this->entityTypeManager
    ->getStorage('file')
    ->loadByProperties([
    'uri' => $uri . '/' . self::GENERIC_FILENAME,
  ]);
  return !empty($files) ? reset($files)
    ->id() : NULL;
}