Skip to content

Commit eafd16d

Browse files
merge magento/2.4.0-develop into magento-tsg/2.4.0-develop-pr58
2 parents 5687a84 + f984c47 commit eafd16d

File tree

12 files changed

+66
-0
lines changed

12 files changed

+66
-0
lines changed

app/code/Magento/MediaGallery/Model/Asset.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,21 @@ class Asset implements AssetInterface
3232
*/
3333
private $title;
3434

35+
/**
36+
* @var string|null
37+
*/
38+
private $description;
39+
3540
/**
3641
* @var string|null
3742
*/
3843
private $source;
3944

45+
/**
46+
* @var string|null
47+
*/
48+
private $hash;
49+
4050
/**
4151
* @var string
4252
*/
@@ -80,7 +90,9 @@ class Asset implements AssetInterface
8090
* @param int $size
8191
* @param int|null $id
8292
* @param string|null $title
93+
* @param string|null $description
8394
* @param string|null $source
95+
* @param string|null $hash
8496
* @param string|null $createdAt
8597
* @param string|null $updatedAt
8698
* @param AssetExtensionInterface|null $extensionAttributes
@@ -93,7 +105,9 @@ public function __construct(
93105
int $size,
94106
?int $id = null,
95107
?string $title = null,
108+
?string $description = null,
96109
?string $source = null,
110+
?string $hash = null,
97111
?string $createdAt = null,
98112
?string $updatedAt = null,
99113
?AssetExtensionInterface $extensionAttributes = null
@@ -105,7 +119,9 @@ public function __construct(
105119
$this->size = $size;
106120
$this->id = $id;
107121
$this->title = $title;
122+
$this->description = $description;
108123
$this->source = $source;
124+
$this->hash = $hash;
109125
$this->createdAt = $createdAt;
110126
$this->updatedAt = $updatedAt;
111127
$this->extensionAttributes = $extensionAttributes;
@@ -135,6 +151,14 @@ public function getTitle(): ?string
135151
return $this->title;
136152
}
137153

154+
/**
155+
* @inheritdoc
156+
*/
157+
public function getDescription(): ?string
158+
{
159+
return $this->description;
160+
}
161+
138162
/**
139163
* @inheritdoc
140164
*/
@@ -143,6 +167,14 @@ public function getSource(): ?string
143167
return $this->source;
144168
}
145169

170+
/**
171+
* @inheritdoc
172+
*/
173+
public function getHash(): ?string
174+
{
175+
return $this->hash;
176+
}
177+
146178
/**
147179
* @inheritdoc
148180
*/

app/code/Magento/MediaGallery/Model/Asset/Command/GetById.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ public function execute(int $mediaAssetId): AssetInterface
9494
'id' => $mediaAssetData['id'],
9595
'path' => $mediaAssetData['path'],
9696
'title' => $mediaAssetData['title'],
97+
'description' => $mediaAssetData['description'],
9798
'source' => $mediaAssetData['source'],
99+
'hash' => $mediaAssetData['hash'],
98100
'contentType' => $mediaAssetData['content_type'],
99101
'width' => $mediaAssetData['width'],
100102
'height' => $mediaAssetData['height'],

app/code/Magento/MediaGallery/Model/Asset/Command/GetByPath.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ public function execute(string $path): AssetInterface
8686
'id' => $data['id'],
8787
'path' => $data['path'],
8888
'title' => $data['title'],
89+
'description' => $data['description'],
8990
'source' => $data['source'],
91+
'hash' => $data['hash'],
9092
'contentType' => $data['content_type'],
9193
'width' => $data['width'],
9294
'height' => $data['height'],

app/code/Magento/MediaGallery/Model/ResourceModel/GetAssetsByIds.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ public function execute(array $ids): array
6565
'id' => $assetData['id'],
6666
'path' => $assetData['path'],
6767
'title' => $assetData['title'],
68+
'description' => $assetData['description'],
6869
'source' => $assetData['source'],
70+
'hash' => $assetData['hash'],
6971
'contentType' => $assetData['content_type'],
7072
'width' => $assetData['width'],
7173
'height' => $assetData['height'],

app/code/Magento/MediaGallery/Model/ResourceModel/GetAssetsByPaths.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ public function execute(array $paths): array
6666
'id' => $assetData['id'],
6767
'path' => $assetData['path'],
6868
'title' => $assetData['title'],
69+
'description' => $assetData['description'],
6970
'source' => $assetData['source'],
71+
'hash' => $assetData['hash'],
7072
'contentType' => $assetData['content_type'],
7173
'width' => $assetData['width'],
7274
'height' => $assetData['height'],

app/code/Magento/MediaGallery/Model/ResourceModel/SaveAssets.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ public function execute(array $assets): void
6060
'id' => $asset->getId(),
6161
'path' => $asset->getPath(),
6262
'title' => $asset->getTitle(),
63+
'description' => $asset->getDescription(),
6364
'source' => $asset->getSource(),
65+
'hash' => $asset->getHash(),
6466
'content_type' => $asset->getContentType(),
6567
'width' => $asset->getWidth(),
6668
'height' => $asset->getHeight(),

app/code/Magento/MediaGallery/Test/Unit/Model/Asset/Command/GetByIdExceptionDuringMediaAssetInitializationTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ class GetByIdExceptionDuringMediaAssetInitializationTest extends TestCase
2828
'id' => 45,
2929
'path' => 'img.jpg',
3030
'title' => 'Img',
31+
'description' => 'Img Description',
3132
'source' => 'Adobe Stock',
33+
'hash' => 'hash',
3234
'content_type' => 'image/jpeg',
3335
'width' => 420,
3436
'height' => 240,

app/code/Magento/MediaGallery/Test/Unit/Model/Asset/Command/GetByIdExceptionOnGetDataTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ class GetByIdExceptionOnGetDataTest extends TestCase
2929
'id' => 45,
3030
'path' => 'img.jpg',
3131
'title' => 'Img',
32+
'description' => 'Img Description',
3233
'source' => 'Adobe Stock',
34+
'hash' => 'hash',
3335
'content_type' => 'image/jpeg',
3436
'width' => 420,
3537
'height' => 240,

app/code/Magento/MediaGallery/Test/Unit/Model/Asset/Command/GetByIdSuccessfulTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ class GetByIdSuccessfulTest extends TestCase
2929
'id' => 45,
3030
'path' => 'img.jpg',
3131
'title' => 'Img',
32+
'description' => 'Img Description',
3233
'source' => 'Adobe Stock',
34+
'hash' => 'hash',
3335
'content_type' => 'image/jpeg',
3436
'width' => 420,
3537
'height' => 240,

app/code/Magento/MediaGallery/etc/db_schema.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
<column xsi:type="int" name="id" unsigned="true" nullable="false" identity="true" comment="Entity ID"/>
1111
<column xsi:type="varchar" name="path" length="255" nullable="true" comment="Path"/>
1212
<column xsi:type="varchar" name="title" length="255" nullable="true" comment="Title"/>
13+
<column xsi:type="text" name="description" nullable="true" comment="Description"/>
1314
<column xsi:type="varchar" name="source" length="255" nullable="true" comment="Source"/>
15+
<column xsi:type="varchar" name="hash" length="255" nullable="true" comment="File hash"/>
1416
<column xsi:type="varchar" name="content_type" length="255" nullable="true" comment="Content Type"/>
1517
<column xsi:type="int" name="width" unsigned="true" nullable="false" identity="false" default="0" comment="Width"/>
1618
<column xsi:type="int" name="height" unsigned="true" nullable="false" identity="false" default="0" comment="Height"/>

0 commit comments

Comments
 (0)