Skip to content

Commit 2b7e6a5

Browse files
committed
#27536: Added content identity implementation of extension attributes
1 parent d7bf23b commit 2b7e6a5

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

app/code/Magento/MediaContent/Model/ContentIdentity.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
use Magento\Framework\Model\AbstractExtensibleModel;
1111
use Magento\MediaContentApi\Api\Data\ContentIdentityInterface;
12+
use Magento\MediaContentApi\Api\Data\ContentIdentityExtensionInterface;
1213

1314
/**
1415
* @inheritdoc
@@ -42,4 +43,20 @@ public function getField(): string
4243
{
4344
return (string) $this->getData(self::FIELD);
4445
}
46+
47+
/**
48+
* @inheritdoc
49+
*/
50+
public function getExtensionAttributes(): ContentIdentityExtensionInterface
51+
{
52+
return $this->_getExtensionAttributes();
53+
}
54+
55+
/**
56+
* @inheritdoc
57+
*/
58+
public function setExtensionAttributes(ContentIdentityExtensionInterface $extensionAttributes): void
59+
{
60+
$this->_setExtensionAttributes($extensionAttributes);
61+
}
4562
}

app/code/Magento/MediaContentApi/Api/Data/ContentIdentityInterface.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
namespace Magento\MediaContentApi\Api\Data;
1010

11+
use Magento\MediaContentApi\Api\Data\ContentIdentityExtensionInterface;
12+
1113
/**
1214
* Data interface representing the identificator of content. I.e. short description field of product entity with id 42
1315
* @api
@@ -34,4 +36,19 @@ public function getEntityId(): string;
3436
* @return string
3537
*/
3638
public function getField(): string;
39+
40+
/**
41+
* Retrieve existing extension attributes object or create a new one.
42+
*
43+
* @return \Magento\MediaContentApi\Api\Data\ContentIdentityExtensionInterface|null
44+
*/
45+
public function getExtensionAttributes(): ContentIdentityExtensionInterface;
46+
47+
/**
48+
* Set extension attributes
49+
*
50+
* @param \Magento\MediaContentApi\Api\Data\ContentIdentityExtensionInterface $extensionAttributes
51+
* @return void
52+
*/
53+
public function setExtensionAttributes(ContentIdentityExtensionInterface $extensionAttributes): void;
3754
}

0 commit comments

Comments
 (0)