Commit ad3b960c by liumengfei

优化bug

parent fbe0e8b4
......@@ -17,7 +17,6 @@ use Magento\Framework\Exception\StateException;
use Magento\Framework\Api\ImageContentValidatorInterface;
use Magento\Framework\View\Asset\NotationResolver\Variable;
use Magento\Framework\Webapi\Rest\Request;
use Magento\Catalog\Model\Product\Gallery\DeleteValidator;
/**
* Class GalleryManagement
......@@ -43,10 +42,6 @@ class GalleryManagement implements \Joshine\Catalog\Api\ProductAttributeMediaGal
*/
private $productInterfaceFactory;
/**
* @var DeleteValidator
*/
private $deleteValidator;
protected $entry;
......@@ -63,15 +58,12 @@ class GalleryManagement implements \Joshine\Catalog\Api\ProductAttributeMediaGal
ImageContentValidatorInterface $contentValidator,
ProductAttributeMediaGalleryEntryInterface $entry,
?ProductInterfaceFactory $productInterfaceFactory = null,
?DeleteValidator $deleteValidator = null
) {
$this->productRepository = $productRepository;
$this->contentValidator = $contentValidator;
$this->productInterfaceFactory = $productInterfaceFactory
?? ObjectManager::getInstance()->get(ProductInterfaceFactory::class);
$this->deleteValidator = $deleteValidator
?? ObjectManager::getInstance()->get(DeleteValidator::class);
$this->entry = $entry;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment