Skip to content

Commit 42c37dd

Browse files
committed
Merge branch 'MAGETWO-26227-Upload-Image-Attribute' into develop
Conflicts: dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php
2 parents 9f20a3c + 838ffa8 commit 42c37dd

38 files changed

+1413
-347
lines changed

app/code/Magento/Catalog/Api/Data/ProductAttributeMediaGalleryEntryContentInterface.php

Lines changed: 0 additions & 81 deletions
This file was deleted.

app/code/Magento/Catalog/Api/Data/ProductAttributeMediaGalleryEntryInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,14 @@ public function setFile($file);
112112
/**
113113
* Get media gallery content
114114
*
115-
* @return \Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryContentInterface|null
115+
* @return \Magento\Framework\Api\Data\ImageContentInterface|null
116116
*/
117117
public function getContent();
118118

119119
/**
120120
* Set media gallery content
121121
*
122-
* @param $content \Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryContentInterface
122+
* @param $content \Magento\Framework\Api\Data\ImageContentInterface
123123
* @return $this
124124
*/
125125
public function setContent($content);

app/code/Magento/Catalog/Model/Product.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
use Magento\Framework\Object\IdentityInterface;
1313
use Magento\Framework\Pricing\Object\SaleableInterface;
1414
use Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterface;
15-
use Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryContentInterface;
15+
use Magento\Framework\Api\Data\ImageContentInterface;
1616

1717
/**
1818
* Catalog product model
@@ -2519,19 +2519,21 @@ public function getMediaGalleryEntries()
25192519
}
25202520

25212521
/**
2522-
* @param ProductAttributeMediaGalleryEntryContentInterface $content
2522+
* @param ImageContentInterface $content
25232523
* @return array
25242524
*/
25252525
protected function convertFromMediaGalleryEntryContentInterface(
2526-
ProductAttributeMediaGalleryEntryContentInterface $content = null
2526+
ImageContentInterface $content = null
25272527
) {
25282528
if ($content == null) {
25292529
return null;
25302530
} else {
25312531
return [
2532-
"entry_data" => $content->getEntryData(),
2533-
"mime_type" => $content->getMimeType(),
2534-
"name" => $content->getName(),
2532+
'data' => [
2533+
ImageContentInterface::BASE64_ENCODED_DATA => $content->getBase64EncodedData(),
2534+
ImageContentInterface::TYPE => $content->getType(),
2535+
ImageContentInterface::NAME => $content->getName(),
2536+
],
25352537
];
25362538
}
25372539
}

app/code/Magento/Catalog/Model/Product/Gallery/Entry.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function getFile()
7676
}
7777

7878
/**
79-
* @return \Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryContentInterface|null
79+
* @return \Magento\Framework\Api\Data\ImageContentInterface|null
8080
*/
8181
public function getContent()
8282
{
@@ -141,7 +141,7 @@ public function setFile($file)
141141
/**
142142
* Set media gallery content
143143
*
144-
* @param $content \Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryContentInterface
144+
* @param $content \Magento\Framework\Api\Data\ImageContentInterface
145145
* @return $this
146146
*/
147147
public function setContent($content)

app/code/Magento/Catalog/Model/Product/Gallery/GalleryManagement.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Magento\Framework\Exception\InputException;
1212
use Magento\Framework\Exception\NoSuchEntityException;
1313
use Magento\Framework\Exception\StateException;
14+
use Magento\Framework\Api\ImageContentValidatorInterface;
1415

1516
/**
1617
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
@@ -28,21 +29,21 @@ class GalleryManagement implements \Magento\Catalog\Api\ProductAttributeMediaGal
2829
protected $productRepository;
2930

3031
/**
31-
* @var \Magento\Catalog\Model\Product\Gallery\ContentValidator
32+
* @var ImageContentValidatorInterface
3233
*/
3334
protected $contentValidator;
3435

3536
/**
3637
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
3738
* @param \Magento\Catalog\Api\ProductRepositoryInterface $productRepository
38-
* @param ContentValidator $contentValidator
39+
* @param ImageContentValidatorInterface $contentValidator
3940
*
4041
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
4142
*/
4243
public function __construct(
4344
\Magento\Store\Model\StoreManagerInterface $storeManager,
4445
\Magento\Catalog\Api\ProductRepositoryInterface $productRepository,
45-
\Magento\Catalog\Model\Product\Gallery\ContentValidator $contentValidator
46+
ImageContentValidatorInterface $contentValidator
4647
) {
4748
$this->productRepository = $productRepository;
4849
$this->storeManager = $storeManager;

app/code/Magento/Catalog/Model/Product/Gallery/MimeTypeExtensionMap.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
*/
77
namespace Magento\Catalog\Model\Product\Gallery;
88

9-
use Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryContentInterface;
10-
use Magento\Framework\Exception\InputException;
11-
129
class MimeTypeExtensionMap
1310
{
1411
/**

app/code/Magento/Catalog/Model/Product/Media/GalleryEntryContent.php

Lines changed: 0 additions & 93 deletions
This file was deleted.

0 commit comments

Comments
 (0)