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