File tree Expand file tree Collapse file tree 2 files changed +17
-10
lines changed
GroupedProduct/Model/Product/Initialization/Helper/ProductLinks/Plugin Expand file tree Collapse file tree 2 files changed +17
-10
lines changed Original file line number Diff line number Diff line change 88 * See COPYING.txt for license details.
99 */
1010
11+ namespace Magento \CatalogRule \Model \Rule ;
12+
13+ use Magento \CatalogRule \Model \Indexer \Rule \RuleProductProcessor ;
14+
1115/**
1216 * Catalog Rule job model
1317 *
1822 * @method bool hasSuccess()
1923 * @method bool hasError()
2024 *
21- * @author Magento Core Team <[email protected] > 22- */
23- namespace Magento \CatalogRule \Model \Rule ;
24-
25- use Magento \CatalogRule \Model \Indexer \Rule \RuleProductProcessor ;
26-
27- /**
25+ * @author Magento Core Team <[email protected] > 26+ *
2827 * @api
2928 * @since 100.0.2
3029 */
@@ -39,10 +38,14 @@ class Job extends \Magento\Framework\DataObject
3938 * Basic object initialization
4039 *
4140 * @param RuleProductProcessor $ruleProcessor
41+ * @param array $data
4242 */
43- public function __construct (RuleProductProcessor $ ruleProcessor )
44- {
43+ public function __construct (
44+ RuleProductProcessor $ ruleProcessor ,
45+ array $ data = []
46+ ) {
4547 $ this ->ruleProcessor = $ ruleProcessor ;
48+ parent ::__construct ($ data );
4649 }
4750
4851 /**
Original file line number Diff line number Diff line change 88use Magento \Catalog \Api \Data \ProductLinkExtensionFactory ;
99use Magento \Catalog \Api \Data \ProductLinkInterfaceFactory ;
1010use Magento \Catalog \Api \ProductRepositoryInterface ;
11+ use Magento \Framework \Exception \NoSuchEntityException ;
1112use Magento \GroupedProduct \Model \Product \Type \Grouped as TypeGrouped ;
1213
1314/**
@@ -60,6 +61,9 @@ public function __construct(
6061 * @param array $links
6162 *
6263 * @return \Magento\Catalog\Model\Product
64+ *
65+ * @throws NoSuchEntityException
66+ *
6367 * @SuppressWarnings(PHPMD.UnusedFormalParameter)
6468 * @SuppressWarnings(PHPMD.CyclomaticComplexity)
6569 * @SuppressWarnings(PHPMD.NPathComplexity)
@@ -70,7 +74,7 @@ public function beforeInitializeLinks(
7074 array $ links
7175 ) {
7276 if ($ product ->getTypeId () === TypeGrouped::TYPE_CODE && !$ product ->getGroupedReadonly ()) {
73- $ links = ( isset ( $ links [self ::TYPE_NAME ])) ? $ links [ self :: TYPE_NAME ] : $ product ->getGroupedLinkData ();
77+ $ links = $ links [self ::TYPE_NAME ] ?? $ product ->getGroupedLinkData ();
7478 if (!is_array ($ links )) {
7579 $ links = [];
7680 }
You can’t perform that action at this time.
0 commit comments