You are here

public function ThumbnailDownloader::processItem in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/media/src/Plugin/QueueWorker/ThumbnailDownloader.php \Drupal\media\Plugin\QueueWorker\ThumbnailDownloader::processItem()
  2. 9 core/modules/media/src/Plugin/QueueWorker/ThumbnailDownloader.php \Drupal\media\Plugin\QueueWorker\ThumbnailDownloader::processItem()

File

core/modules/media/src/Plugin/QueueWorker/ThumbnailDownloader.php, line 60

Class

ThumbnailDownloader
Process a queue of media items to fetch their thumbnails.

Namespace

Drupal\media\Plugin\QueueWorker

Code

public function processItem($data) {

  /** @var \Drupal\media\Entity\Media $media */
  if ($media = $this->entityTypeManager
    ->getStorage('media')
    ->load($data['id'])) {
    $media
      ->updateQueuedThumbnail();
    $media
      ->save();
  }
}