File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
app/code/Magento/GroupedProduct/Model/Product/Initialization/Helper/ProductLinks/Plugin Expand file tree Collapse file tree 1 file changed +5
-1
lines changed 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