Skip to content

Commit 3d87303

Browse files
author
Mohammad HAJ SALEM
committed
👌 apply code enhancement
1 parent da1833a commit 3d87303

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

app/code/Magento/Catalog/Model/Product/Link/SaveHandler.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,10 @@ public function execute($entityType, $entity)
6969
$this->productLinkRepository->delete($link);
7070
}
7171
}
72-
$productLinks = $entity->getProductLinks();
7372

7473
// Build links per type
7574
$linksByType = [];
76-
foreach ($productLinks as $link) {
75+
foreach ($entity->getProductLinks() as $link) {
7776
$linksByType[$link->getLinkType()][] = $link;
7877
}
7978

@@ -99,10 +98,10 @@ public function execute($entityType, $entity)
9998

10099
/**
101100
* Check if at least one link without position
102-
* @param $links
101+
* @param array $links
103102
* @return bool
104103
*/
105-
public function hasPosition($links)
104+
private function hasPosition($links)
106105
{
107106
foreach ($links as $link) {
108107
if (!array_key_exists('position', $link->getData())) {

0 commit comments

Comments
 (0)