File tree Expand file tree Collapse file tree 4 files changed +26
-6
lines changed Expand file tree Collapse file tree 4 files changed +26
-6
lines changed Original file line number Diff line number Diff line change 12
12
interface ProductWebsiteLinkInterface
13
13
{
14
14
/**
15
- * @return string|null
15
+ * @return string
16
16
*/
17
17
public function getSku ();
18
18
Original file line number Diff line number Diff line change 9
9
interface ProductWebsiteLinkRepositoryInterface
10
10
{
11
11
/**
12
- * Assign a product to the websites
12
+ * Assign a product to the website
13
13
*
14
14
* @param \Magento\Catalog\Api\Data\ProductWebsiteLinkInterface $productWebsiteLink
15
- * @return bool will returned True if assigned
15
+ * @return bool will returned True if website successfully assigned to product
16
16
*
17
17
* @throws \Magento\Framework\Exception\CouldNotSaveException
18
18
* @throws \Magento\Framework\Exception\InputException
19
19
*/
20
20
public function save (Data \ProductWebsiteLinkInterface $ productWebsiteLink );
21
21
22
22
/**
23
- * Remove the websites assignment from the product by product sku
23
+ * Remove the website assignment from the product
24
+ *
25
+ * @param \Magento\Catalog\Api\Data\ProductWebsiteLinkInterface $productWebsiteLink
26
+ * @return bool will returned True if website successfully unassigned from product
27
+ *
28
+ * @throws \Magento\Framework\Exception\CouldNotSaveException
29
+ */
30
+ public function delete (Data \ProductWebsiteLinkInterface $ productWebsiteLink );
31
+
32
+ /**
33
+ * Remove the website assignment from the product by product sku
24
34
*
25
35
* @param string $sku
26
36
* @param int $websiteId
27
- * @return bool will returned True if websites successfully unassigned from product
37
+ * @return bool will returned True if website successfully unassigned from product
28
38
*
29
- * @throws \Magento\Framework\Exception\StateException
39
+ * @throws \Magento\Framework\Exception\CouldNotSaveException
30
40
*/
31
41
public function deleteById ($ sku , $ websiteId );
32
42
}
Original file line number Diff line number Diff line change @@ -51,6 +51,14 @@ public function save(ProductWebsiteLinkInterface $productWebsiteLink)
51
51
return true ;
52
52
}
53
53
54
+ /**
55
+ * {@inheritdoc}
56
+ */
57
+ public function delete (ProductWebsiteLinkInterface $ productLink )
58
+ {
59
+ return $ this ->deleteById ($ productLink ->getSku (), $ productLink ->getSku ());
60
+ }
61
+
54
62
/**
55
63
* {@inheritdoc}
56
64
*/
Original file line number Diff line number Diff line change 385
385
<resource ref =" Magento_Catalog::categories" />
386
386
</resources >
387
387
</route >
388
+
389
+ <!-- Product Website Links -->
388
390
<route url =" /V1/products/:sku/websites" method =" POST" >
389
391
<service class =" Magento\Catalog\Api\ProductWebsiteLinkRepositoryInterface" method =" save" />
390
392
<resources >
You can’t perform that action at this time.
0 commit comments