function ThumbnailDownloader::processItem

Same name in other branches
  1. 9 core/modules/media/src/Plugin/QueueWorker/ThumbnailDownloader.php \Drupal\media\Plugin\QueueWorker\ThumbnailDownloader::processItem()
  2. 8.9.x core/modules/media/src/Plugin/QueueWorker/ThumbnailDownloader.php \Drupal\media\Plugin\QueueWorker\ThumbnailDownloader::processItem()
  3. 10 core/modules/media/src/Plugin/QueueWorker/ThumbnailDownloader.php \Drupal\media\Plugin\QueueWorker\ThumbnailDownloader::processItem()

File

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

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();
    }
}

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