@@ -498,8 +498,9 @@ protected function _getResource()
498
498
}
499
499
500
500
/**
501
- * Get a list of custom attribute codes that belongs to product attribute set. If attribute set not specified for
502
- * product will return all product attribute codes
501
+ * Get a list of custom attribute codes that belongs to product attribute set.
502
+ *
503
+ * If attribute set not specified fors product will return all product attribute codes
503
504
*
504
505
* @return string[]
505
506
*/
@@ -514,7 +515,8 @@ protected function getCustomAttributesCodes()
514
515
$ this
515
516
)
516
517
)
517
- ), ProductInterface::ATTRIBUTES
518
+ ),
519
+ ProductInterface::ATTRIBUTES
518
520
);
519
521
}
520
522
@@ -587,8 +589,9 @@ public function getPrice()
587
589
}
588
590
589
591
/**
590
- * @codeCoverageIgnoreStart
591
592
* Get visibility status
593
+ *
594
+ * @codeCoverageIgnoreStart
592
595
* @see \Magento\Catalog\Model\Product\Visibility
593
596
*
594
597
* @return int
@@ -665,6 +668,7 @@ public function getStatus()
665
668
666
669
/**
667
670
* Retrieve type instance of the product.
671
+ *
668
672
* Type instance implements product type depended logic and is a singleton shared by all products of the same type.
669
673
*
670
674
* @return \Magento\Catalog\Model\Product\Type\AbstractType
@@ -825,9 +829,10 @@ public function getStoreIds()
825
829
826
830
/**
827
831
* Retrieve product attributes
828
- * if $groupId is null - retrieve all product attributes
829
832
*
830
- * @param int $groupId Retrieve attributes of the specified group
833
+ * If $groupId is null - retrieve all product attributes
834
+ *
835
+ * @param int $groupId Retrieve attributes of the specified group
831
836
* @param bool $skipSuper Not used
832
837
* @return \Magento\Eav\Model\Entity\Attribute\AbstractAttribute[]
833
838
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
@@ -919,6 +924,7 @@ public function beforeSave()
919
924
920
925
/**
921
926
* Check/set if options can be affected when saving product
927
+ *
922
928
* If value specified, it will be set.
923
929
*
924
930
* @param bool $value
@@ -1039,9 +1045,11 @@ public function reindex()
1039
1045
1040
1046
/**
1041
1047
* Clear cache related with product and protect delete from not admin
1048
+ *
1042
1049
* Register indexing event before delete product
1043
1050
*
1044
1051
* @return \Magento\Catalog\Model\Product
1052
+ * @throws \Magento\Framework\Exception\LocalizedException
1045
1053
*/
1046
1054
public function beforeDelete ()
1047
1055
{
@@ -1548,12 +1556,12 @@ public function hasGalleryAttribute()
1548
1556
/**
1549
1557
* Add image to media gallery
1550
1558
*
1551
- * @param string $file file path of image in file system
1552
- * @param string|array $mediaAttribute code of attribute with type 'media_image',
1553
- * leave blank if image should be only in gallery
1554
- * @param boolean $move if true, it will move source file
1555
- * @param boolean $exclude mark image as disabled in product page view
1559
+ * @param string $file file path of image in file system
1560
+ * @param string|array $mediaAttribute code of type 'media_image', leave blank if image should be only in gallery
1561
+ * @param boolean $move if true, it will move source file
1562
+ * @param boolean $exclude mark image as disabled in product page view
1556
1563
* @return \Magento\Catalog\Model\Product
1564
+ * @throws \Magento\Framework\Exception\LocalizedException
1557
1565
*/
1558
1566
public function addImageToMediaGallery ($ file , $ mediaAttribute = null , $ move = false , $ exclude = true )
1559
1567
{
@@ -1714,7 +1722,6 @@ public function getIsSalable()
1714
1722
1715
1723
/**
1716
1724
* Check is a virtual product
1717
- * Data helper wrapper
1718
1725
*
1719
1726
* @return bool
1720
1727
*/
@@ -1807,8 +1814,8 @@ public function formatUrlKey($str)
1807
1814
* Save current attribute with code $code and assign new value
1808
1815
*
1809
1816
* @param string $code Attribute code
1810
- * @param mixed $value New attribute value
1811
- * @param int $store Store ID
1817
+ * @param mixed $value New attribute value
1818
+ * @param int $store Store ID
1812
1819
* @return void
1813
1820
*/
1814
1821
public function addAttributeUpdate ($ code , $ value , $ store )
@@ -1878,6 +1885,7 @@ public function getRequestPath()
1878
1885
1879
1886
/**
1880
1887
* Custom function for other modules
1888
+ *
1881
1889
* @return string
1882
1890
*/
1883
1891
public function getGiftMessageAvailable ()
@@ -1996,6 +2004,8 @@ public function getOptions()
1996
2004
}
1997
2005
1998
2006
/**
2007
+ * Set options for product
2008
+ *
1999
2009
* @param \Magento\Catalog\Api\Data\ProductCustomOptionInterface[] $options
2000
2010
* @return $this
2001
2011
*/
@@ -2019,10 +2029,10 @@ public function getIsVirtual()
2019
2029
/**
2020
2030
* Add custom option information to product
2021
2031
*
2022
- * @param string $code Option code
2023
- * @param mixed $value Value of the option
2024
- * @param int|Product $product Product ID
2025
- * @return $this
2032
+ * @param string $code Option code
2033
+ * @param mixed $value Value of the option
2034
+ * @param int|Product $product Product ID
2035
+ * @return $this
2026
2036
*/
2027
2037
public function addCustomOption ($ code , $ value , $ product = null )
2028
2038
{
@@ -2216,6 +2226,7 @@ public function getPreconfiguredValues()
2216
2226
2217
2227
/**
2218
2228
* Prepare product custom options.
2229
+ *
2219
2230
* To be sure that all product custom options does not has ID and has product instance
2220
2231
*
2221
2232
* @return \Magento\Catalog\Model\Product
@@ -2550,17 +2561,17 @@ public function setTypeId($typeId)
2550
2561
}
2551
2562
2552
2563
/**
2553
- * {@inheritdoc}
2564
+ * Retrieve existing extension attributes object or create a new one.
2554
2565
*
2555
- * @return \Magento\Catalog \Api\Data\ProductExtensionInterface
2566
+ * @return \Magento\Framework \Api\ExtensionAttributesInterface
2556
2567
*/
2557
2568
public function getExtensionAttributes ()
2558
2569
{
2559
2570
return $ this ->_getExtensionAttributes ();
2560
2571
}
2561
2572
2562
2573
/**
2563
- * {@inheritdoc}
2574
+ * Set an extension attributes object.
2564
2575
*
2565
2576
* @param \Magento\Catalog\Api\Data\ProductExtensionInterface $extensionAttributes
2566
2577
* @return $this
@@ -2573,8 +2584,11 @@ public function setExtensionAttributes(\Magento\Catalog\Api\Data\ProductExtensio
2573
2584
//@codeCoverageIgnoreEnd
2574
2585
2575
2586
/**
2587
+ * Convert to media gallery interface
2588
+ *
2576
2589
* @param array $mediaGallery
2577
2590
* @return \Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterface[]
2591
+ * @throws \Magento\Framework\Exception\LocalizedException
2578
2592
*/
2579
2593
protected function convertToMediaGalleryInterface (array $ mediaGallery )
2580
2594
{
@@ -2590,7 +2604,10 @@ protected function convertToMediaGalleryInterface(array $mediaGallery)
2590
2604
}
2591
2605
2592
2606
/**
2607
+ * Get media gallery entries
2608
+ *
2593
2609
* @return \Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterface[]|null
2610
+ * @throws \Magento\Framework\Exception\LocalizedException
2594
2611
*/
2595
2612
public function getMediaGalleryEntries ()
2596
2613
{
@@ -2604,8 +2621,11 @@ public function getMediaGalleryEntries()
2604
2621
}
2605
2622
2606
2623
/**
2624
+ * Set media gallery entries
2625
+ *
2607
2626
* @param ProductAttributeMediaGalleryEntryInterface[] $mediaGalleryEntries
2608
2627
* @return $this
2628
+ * @throws \Magento\Framework\Exception\LocalizedException
2609
2629
*/
2610
2630
public function setMediaGalleryEntries (array $ mediaGalleryEntries = null )
2611
2631
{
@@ -2646,6 +2666,8 @@ public function setId($value)
2646
2666
}
2647
2667
2648
2668
/**
2669
+ * Get link repository
2670
+ *
2649
2671
* @return ProductLinkRepositoryInterface
2650
2672
*/
2651
2673
private function getLinkRepository ()
@@ -2658,6 +2680,8 @@ private function getLinkRepository()
2658
2680
}
2659
2681
2660
2682
/**
2683
+ * Get media gallery processor
2684
+ *
2661
2685
* @return Product\Gallery\Processor
2662
2686
*/
2663
2687
private function getMediaGalleryProcessor ()
0 commit comments