getProduct(); if ($product === null) { throw new \RuntimeException('BuildProductJob requires an existing ProductDTO.'); } $result->addLog(sprintf('[%s] building validated product DTO for %s.', $this->getName(), $product->getId())); if (trim($product->getName()) === '') { throw new ImportException('Cannot build product with empty name.'); } $result->setProduct(new ProductDTO( $product->getId(), $product->getName(), $product->getDescription(), $product->getShortDescription(), $product->getPrice(), $product->getInventory(), $product->getCategories(), $product->getImages(), $product->getAttributes(), $product->getSeo(), $product->getProviderInfo(), $product->getSku(), $product->getBarcode() )); $result->addLog(sprintf('[%s] product DTO built for %s.', $this->getName(), $product->getId())); return $result; } }