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 8
8
* See COPYING.txt for license details.
9
9
*/
10
10
11
+ namespace Magento \CatalogRule \Model \Rule ;
12
+
13
+ use Magento \CatalogRule \Model \Indexer \Rule \RuleProductProcessor ;
14
+
11
15
/**
12
16
* Catalog Rule job model
13
17
*
18
22
* @method bool hasSuccess()
19
23
* @method bool hasError()
20
24
*
21
- * @author Magento Core Team <core@magentocommerce.com>
22
- */
23
- namespace Magento \CatalogRule \Model \Rule ;
24
-
25
- use Magento \CatalogRule \Model \Indexer \Rule \RuleProductProcessor ;
26
-
27
- /**
25
+ * @author Magento Core Team <core@magentocommerce.com>
26
+ *
28
27
* @api
29
28
* @since 100.0.2
30
29
*/
@@ -39,10 +38,14 @@ class Job extends \Magento\Framework\DataObject
39
38
* Basic object initialization
40
39
*
41
40
* @param RuleProductProcessor $ruleProcessor
41
+ * @param array $data
42
42
*/
43
- public function __construct (RuleProductProcessor $ ruleProcessor )
44
- {
43
+ public function __construct (
44
+ RuleProductProcessor $ ruleProcessor ,
45
+ array $ data = []
46
+ ) {
45
47
$ this ->ruleProcessor = $ ruleProcessor ;
48
+ parent ::__construct ($ data );
46
49
}
47
50
48
51
/**
Original file line number Diff line number Diff line change 8
8
use Magento \Catalog \Api \Data \ProductLinkExtensionFactory ;
9
9
use Magento \Catalog \Api \Data \ProductLinkInterfaceFactory ;
10
10
use Magento \Catalog \Api \ProductRepositoryInterface ;
11
+ use Magento \Framework \Exception \NoSuchEntityException ;
11
12
use Magento \GroupedProduct \Model \Product \Type \Grouped as TypeGrouped ;
12
13
13
14
/**
@@ -60,6 +61,9 @@ public function __construct(
60
61
* @param array $links
61
62
*
62
63
* @return \Magento\Catalog\Model\Product
64
+ *
65
+ * @throws NoSuchEntityException
66
+ *
63
67
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
64
68
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
65
69
* @SuppressWarnings(PHPMD.NPathComplexity)
@@ -70,7 +74,7 @@ public function beforeInitializeLinks(
70
74
array $ links
71
75
) {
72
76
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 ();
74
78
if (!is_array ($ links )) {
75
79
$ links = [];
76
80
}
You can’t perform that action at this time.
0 commit comments