getProduct(); if ($product === null) { throw new \RuntimeException('ImageDownloadJob requires an existing ProductDTO.'); } $result->addLog(sprintf('[%s] preparing image placeholders for %s.', $this->getName(), $product->getName())); $images = array_map(static fn (ImageDTO $image): ImageDTO => new ImageDTO( $image->getUrl(), $image->getAlt(), $image->getTitle() ), $product->getImages()); $result->setProduct(new ProductDTO( $product->getId(), $product->getName(), $product->getDescription(), $product->getShortDescription(), $product->getPrice(), $product->getInventory(), $product->getCategories(), $images, $product->getAttributes(), $product->getSeo(), $product->getProviderInfo(), $product->getSku(), $product->getBarcode() )); $result->addLog(sprintf('[%s] image placeholders prepared for %s.', $this->getName(), $product->getId())); return $result; } }