|
1 | 1 | <?php
|
2 | 2 | /**
|
3 |
| - * |
4 | 3 | * Copyright © Magento, Inc. All rights reserved.
|
5 | 4 | * See COPYING.txt for license details.
|
6 | 5 | */
|
|
11 | 10 | use Magento\Framework\Exception\NoSuchEntityException;
|
12 | 11 | use Magento\Framework\Exception\StateException;
|
13 | 12 |
|
| 13 | +/** |
| 14 | + * Configurable product link management. |
| 15 | + * |
| 16 | + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) |
| 17 | + */ |
14 | 18 | class LinkManagement implements \Magento\ConfigurableProduct\Api\LinkManagementInterface
|
15 | 19 | {
|
16 | 20 | /**
|
@@ -68,7 +72,7 @@ public function __construct(
|
68 | 72 | }
|
69 | 73 |
|
70 | 74 | /**
|
71 |
| - * {@inheritdoc} |
| 75 | + * @inheritdoc |
72 | 76 | */
|
73 | 77 | public function getChildren($sku)
|
74 | 78 | {
|
@@ -107,11 +111,15 @@ public function getChildren($sku)
|
107 | 111 | }
|
108 | 112 |
|
109 | 113 | /**
|
110 |
| - * {@inheritdoc} |
| 114 | + * @inheritdoc |
| 115 | + * @throws InputException |
| 116 | + * @throws NoSuchEntityException |
| 117 | + * @throws StateException |
| 118 | + * @throws \Magento\Framework\Exception\CouldNotSaveException |
111 | 119 | */
|
112 | 120 | public function addChild($sku, $childSku)
|
113 | 121 | {
|
114 |
| - $product = $this->productRepository->get($sku); |
| 122 | + $product = $this->productRepository->get($sku, true); |
115 | 123 | $child = $this->productRepository->get($childSku);
|
116 | 124 |
|
117 | 125 | $childrenIds = array_values($this->configurableType->getChildrenIds($product->getId())[0]);
|
@@ -150,7 +158,11 @@ public function addChild($sku, $childSku)
|
150 | 158 | }
|
151 | 159 |
|
152 | 160 | /**
|
153 |
| - * {@inheritdoc} |
| 161 | + * @inheritdoc |
| 162 | + * @throws InputException |
| 163 | + * @throws NoSuchEntityException |
| 164 | + * @throws StateException |
| 165 | + * @throws \Magento\Framework\Exception\CouldNotSaveException |
154 | 166 | */
|
155 | 167 | public function removeChild($sku, $childSku)
|
156 | 168 | {
|
|
0 commit comments