3 namespace Drupal\media_entity\Plugin\QueueWorker;
5 use Drupal\media_entity\Entity\Media;
6 use Drupal\Core\Queue\QueueWorkerBase;
12 * id = "media_entity_thumbnail",
13 * title = @Translation("Thumbnail downloader"),
14 * cron = {"time" = 60}
17 class ThumbnailDownloader extends QueueWorkerBase {
22 public function processItem($data) {
23 if ($entity = Media::load($data['id'])) {
24 // Indicate that the entity is being processed from a queue and that
25 // thumbnail images should be downloaded.
26 $entity->setQueuedThumbnailDownload();