From ca2baa98d82e901914a642f3bcc310a1199710ee Mon Sep 17 00:00:00 2001 From: Viktor Kopin Date: Tue, 17 Nov 2020 10:30:46 +0200 Subject: [PATCH] MC-38993: Magento\Authorization\Model\ResourceModel\Rules missing update method --- .../Magento/Authorization/Model/Rules.php | 32 ++++++------------- .../Test/Legacy/_files/obsolete_methods.php | 1 + 2 files changed, 10 insertions(+), 23 deletions(-) diff --git a/app/code/Magento/Authorization/Model/Rules.php b/app/code/Magento/Authorization/Model/Rules.php index 07ce8e57e3933..44e254fac6201 100644 --- a/app/code/Magento/Authorization/Model/Rules.php +++ b/app/code/Magento/Authorization/Model/Rules.php @@ -25,28 +25,7 @@ class Rules extends \Magento\Framework\Model\AbstractModel { /** - * Class constructor - * - * @param \Magento\Framework\Model\Context $context - * @param \Magento\Framework\Registry $registry - * @param \Magento\Authorization\Model\ResourceModel\Rules $resource - * @param \Magento\Authorization\Model\ResourceModel\Rules\Collection $resourceCollection - * @param array $data - */ - public function __construct( - \Magento\Framework\Model\Context $context, - \Magento\Framework\Registry $registry, - \Magento\Authorization\Model\ResourceModel\Rules $resource, - \Magento\Authorization\Model\ResourceModel\Rules\Collection $resourceCollection, - array $data = [] - ) { - parent::__construct($context, $registry, $resource, $resourceCollection, $data); - } - - /** - * Class constructor - * - * @return void + * @inheritdoc */ protected function _construct() { @@ -54,15 +33,22 @@ protected function _construct() } /** + * Obsolete method of update + * * @return $this + * @deprecated Method was never implemented and used. */ public function update() { - $this->getResource()->update($this); + // phpcs:disable Magento2.Functions.DiscouragedFunction + trigger_error('Method was never implemented and used.', E_USER_DEPRECATED); + return $this; } /** + * Save authorization rule relation + * * @return $this */ public function saveRel() diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php index ff8e7db0f4260..d6a4053448fc8 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php @@ -2569,4 +2569,5 @@ 'Magento\Framework\MessageQueue\ConsumerInterface' ], ['isOrderIncrementIdUsed', 'Magento\Quote\Model\ResourceModel\Quote', 'Magento\Sales\Model\OrderIncrementIdChecker::isIncrementIdUsed'], + ['update', 'Magento\Authorization\Model\Rules', 'Magento\Authorization\Model\Rules::update'], ];