Skip to content

Commit

Permalink
Refactor Category Link: Replace deprecated interface, clean the code
Browse files Browse the repository at this point in the history
  • Loading branch information
lbajsarowicz committed Aug 15, 2020
1 parent 4930963 commit 987b162
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions app/code/Magento/Catalog/Model/CategoryLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,32 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\Catalog\Model;

use Magento\Catalog\Api\Data\CategoryLinkExtensionInterface;
use Magento\Catalog\Api\Data\CategoryLinkInterface;
use Magento\Framework\Model\AbstractExtensibleModel;

/**
* @codeCoverageIgnore
*/
class CategoryLink extends \Magento\Framework\Api\AbstractExtensibleObject implements
\Magento\Catalog\Api\Data\CategoryLinkInterface
class CategoryLink extends AbstractExtensibleModel implements CategoryLinkInterface
{
/**#@+
* Constants
*/
const KEY_POSITION = 'position';
const KEY_CATEGORY_ID = 'category_id';
/**#@-*/
public const KEY_POSITION = 'position';
public const KEY_CATEGORY_ID = 'category_id';

/**
* {@inheritdoc}
* @inheritdoc
*/
public function getPosition()
{
return $this->_get(self::KEY_POSITION);
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function getCategoryId()
{
Expand Down Expand Up @@ -56,7 +56,7 @@ public function setCategoryId($categoryId)
}

/**
* {@inheritdoc}
* @inheritdoc
*
* @return \Magento\Catalog\Api\Data\CategoryLinkExtensionInterface|null
*/
Expand All @@ -66,14 +66,13 @@ public function getExtensionAttributes()
}

/**
* {@inheritdoc}
* @inheritdoc
*
* @param \Magento\Catalog\Api\Data\CategoryLinkExtensionInterface $extensionAttributes
* @return $this
*/
public function setExtensionAttributes(
\Magento\Catalog\Api\Data\CategoryLinkExtensionInterface $extensionAttributes
) {
public function setExtensionAttributes(CategoryLinkExtensionInterface $extensionAttributes)
{
return $this->_setExtensionAttributes($extensionAttributes);
}
}

0 comments on commit 987b162

Please sign in to comment.