Skip to content

Commit 987b162

Browse files
committed
Refactor Category Link: Replace deprecated interface, clean the code
1 parent 4930963 commit 987b162

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

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

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,32 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
67

78
namespace Magento\Catalog\Model;
89

10+
use Magento\Catalog\Api\Data\CategoryLinkExtensionInterface;
11+
use Magento\Catalog\Api\Data\CategoryLinkInterface;
12+
use Magento\Framework\Model\AbstractExtensibleModel;
13+
914
/**
1015
* @codeCoverageIgnore
1116
*/
12-
class CategoryLink extends \Magento\Framework\Api\AbstractExtensibleObject implements
13-
\Magento\Catalog\Api\Data\CategoryLinkInterface
17+
class CategoryLink extends AbstractExtensibleModel implements CategoryLinkInterface
1418
{
15-
/**#@+
16-
* Constants
17-
*/
18-
const KEY_POSITION = 'position';
19-
const KEY_CATEGORY_ID = 'category_id';
20-
/**#@-*/
19+
public const KEY_POSITION = 'position';
20+
public const KEY_CATEGORY_ID = 'category_id';
2121

2222
/**
23-
* {@inheritdoc}
23+
* @inheritdoc
2424
*/
2525
public function getPosition()
2626
{
2727
return $this->_get(self::KEY_POSITION);
2828
}
2929

3030
/**
31-
* {@inheritdoc}
31+
* @inheritdoc
3232
*/
3333
public function getCategoryId()
3434
{
@@ -56,7 +56,7 @@ public function setCategoryId($categoryId)
5656
}
5757

5858
/**
59-
* {@inheritdoc}
59+
* @inheritdoc
6060
*
6161
* @return \Magento\Catalog\Api\Data\CategoryLinkExtensionInterface|null
6262
*/
@@ -66,14 +66,13 @@ public function getExtensionAttributes()
6666
}
6767

6868
/**
69-
* {@inheritdoc}
69+
* @inheritdoc
7070
*
7171
* @param \Magento\Catalog\Api\Data\CategoryLinkExtensionInterface $extensionAttributes
7272
* @return $this
7373
*/
74-
public function setExtensionAttributes(
75-
\Magento\Catalog\Api\Data\CategoryLinkExtensionInterface $extensionAttributes
76-
) {
74+
public function setExtensionAttributes(CategoryLinkExtensionInterface $extensionAttributes)
75+
{
7776
return $this->_setExtensionAttributes($extensionAttributes);
7877
}
7978
}

0 commit comments

Comments
 (0)