@@ -497,11 +497,13 @@ protected function _getResource()
497
497
return parent ::_getResource ();
498
498
}
499
499
500
+ //@codeCoverageIgnoreStart
500
501
/**
501
502
* Get a list of custom attribute codes that belongs to product attribute set. If attribute set not specified for
502
503
* product will return all product attribute codes
503
504
*
504
505
* @return string[]
506
+ * //@codeCoverageIgnoreEnd
505
507
*/
506
508
protected function getCustomAttributesCodes ()
507
509
{
@@ -584,11 +586,12 @@ public function getPrice()
584
586
}
585
587
586
588
/**
587
- * @codeCoverageIgnoreStart
588
589
* Get visibility status
590
+ *
589
591
* @see \Magento\Catalog\Model\Product\Visibility
590
592
*
591
593
* @return int
594
+ * @codeCoverageIgnoreStart
592
595
*/
593
596
public function getVisibility ()
594
597
{
@@ -824,10 +827,9 @@ public function getStoreIds()
824
827
}
825
828
826
829
/**
827
- * Retrieve product attributes
828
- * if $groupId is null - retrieve all product attributes
830
+ * Retrieve product attributes. If $groupId is null - retrieve all product attributes
829
831
*
830
- * @param int $groupId Retrieve attributes of the specified group
832
+ * @param int|null $groupId Retrieve attributes of the specified group
831
833
* @param bool $skipSuper Not used
832
834
* @return \Magento\Eav\Model\Entity\Attribute\AbstractAttribute[]
833
835
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
@@ -918,10 +920,9 @@ public function beforeSave()
918
920
}
919
921
920
922
/**
921
- * Check/set if options can be affected when saving product
922
- * If value specified, it will be set.
923
+ * Check/set if options can be affected when saving product. If value specified, it will be set.
923
924
*
924
- * @param bool $value
925
+ * @param bool|null $value
925
926
* @return bool
926
927
*/
927
928
public function canAffectOptions ($ value = null )
@@ -1038,10 +1039,10 @@ public function reindex()
1038
1039
}
1039
1040
1040
1041
/**
1041
- * Clear cache related with product and protect delete from not admin
1042
- * Register indexing event before delete product
1042
+ * Clear cache related with product and protect delete from not admin. Register indexing event before delete product
1043
1043
*
1044
- * @return \Magento\Catalog\Model\Product
1044
+ * @return $this
1045
+ * @throws \Magento\Framework\Exception\LocalizedException
1045
1046
*/
1046
1047
public function beforeDelete ()
1047
1048
{
@@ -1548,12 +1549,13 @@ public function hasGalleryAttribute()
1548
1549
/**
1549
1550
* Add image to media gallery
1550
1551
*
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
1556
- * @return \Magento\Catalog\Model\Product
1552
+ * @param string $file File path of image in file system
1553
+ * @param null|string|array $mediaAttribute Code of attribute with type 'media_image'
1554
+ * Leave blank if image should be only in gallery
1555
+ * @param bool $move If true, it will move source file
1556
+ * @param bool $exclude Mark image as disabled in product page view
1557
+ * @return $this
1558
+ * @throws \Magento\Framework\Exception\LocalizedException
1557
1559
*/
1558
1560
public function addImageToMediaGallery ($ file , $ mediaAttribute = null , $ move = false , $ exclude = true )
1559
1561
{
@@ -1714,7 +1716,6 @@ public function getIsSalable()
1714
1716
1715
1717
/**
1716
1718
* Check is a virtual product
1717
- * Data helper wrapper
1718
1719
*
1719
1720
* @return bool
1720
1721
*/
@@ -1806,9 +1807,9 @@ public function formatUrlKey($str)
1806
1807
/**
1807
1808
* Save current attribute with code $code and assign new value
1808
1809
*
1809
- * @param string $code Attribute code
1810
- * @param mixed $value New attribute value
1811
- * @param int $store Store ID
1810
+ * @param string $code Attribute code
1811
+ * @param mixed $value New attribute value
1812
+ * @param int $store Store ID
1812
1813
* @return void
1813
1814
*/
1814
1815
public function addAttributeUpdate ($ code , $ value , $ store )
@@ -1878,6 +1879,7 @@ public function getRequestPath()
1878
1879
1879
1880
/**
1880
1881
* Custom function for other modules
1882
+ *
1881
1883
* @return string
1882
1884
*/
1883
1885
public function getGiftMessageAvailable ()
@@ -1996,6 +1998,8 @@ public function getOptions()
1996
1998
}
1997
1999
1998
2000
/**
2001
+ * Set Options
2002
+ *
1999
2003
* @param \Magento\Catalog\Api\Data\ProductCustomOptionInterface[] $options
2000
2004
* @return $this
2001
2005
*/
@@ -2019,10 +2023,10 @@ public function getIsVirtual()
2019
2023
/**
2020
2024
* Add custom option information to product
2021
2025
*
2022
- * @param string $code Option code
2023
- * @param mixed $value Value of the option
2024
- * @param int|Product $product Product ID
2025
- * @return $this
2026
+ * @param string $code Option code
2027
+ * @param mixed $value Value of the option
2028
+ * @param int|Product|null $product Product ID
2029
+ * @return $this
2026
2030
*/
2027
2031
public function addCustomOption ($ code , $ value , $ product = null )
2028
2032
{
@@ -2215,8 +2219,7 @@ public function getPreconfiguredValues()
2215
2219
}
2216
2220
2217
2221
/**
2218
- * Prepare product custom options.
2219
- * To be sure that all product custom options does not has ID and has product instance
2222
+ * Prepare product custom options.To be sure that all product custom options does not has ID and has product instance
2220
2223
*
2221
2224
* @return \Magento\Catalog\Model\Product
2222
2225
*/
@@ -2550,7 +2553,7 @@ public function setTypeId($typeId)
2550
2553
}
2551
2554
2552
2555
/**
2553
- * {@inheritdoc}
2556
+ * Get Extension Attributes
2554
2557
*
2555
2558
* @return \Magento\Catalog\Api\Data\ProductExtensionInterface
2556
2559
*/
@@ -2560,7 +2563,7 @@ public function getExtensionAttributes()
2560
2563
}
2561
2564
2562
2565
/**
2563
- * {@inheritdoc}
2566
+ * Set Extension Attributes
2564
2567
*
2565
2568
* @param \Magento\Catalog\Api\Data\ProductExtensionInterface $extensionAttributes
2566
2569
* @return $this
@@ -2573,8 +2576,11 @@ public function setExtensionAttributes(\Magento\Catalog\Api\Data\ProductExtensio
2573
2576
//@codeCoverageIgnoreEnd
2574
2577
2575
2578
/**
2579
+ * Convert Image to ProductAttributeMediaGalleryEntryInterface
2580
+ *
2576
2581
* @param array $mediaGallery
2577
2582
* @return \Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterface[]
2583
+ * @throws \Magento\Framework\Exception\LocalizedException
2578
2584
*/
2579
2585
protected function convertToMediaGalleryInterface (array $ mediaGallery )
2580
2586
{
@@ -2590,7 +2596,10 @@ protected function convertToMediaGalleryInterface(array $mediaGallery)
2590
2596
}
2591
2597
2592
2598
/**
2599
+ * Get Media Gallery
2600
+ *
2593
2601
* @return \Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterface[]|null
2602
+ * @throws \Magento\Framework\Exception\LocalizedException
2594
2603
*/
2595
2604
public function getMediaGalleryEntries ()
2596
2605
{
@@ -2604,8 +2613,11 @@ public function getMediaGalleryEntries()
2604
2613
}
2605
2614
2606
2615
/**
2616
+ * Set Media Gallery
2617
+ *
2607
2618
* @param ProductAttributeMediaGalleryEntryInterface[] $mediaGalleryEntries
2608
2619
* @return $this
2620
+ * @throws \Magento\Framework\Exception\LocalizedException
2609
2621
*/
2610
2622
public function setMediaGalleryEntries (array $ mediaGalleryEntries = null )
2611
2623
{
@@ -2646,6 +2658,8 @@ public function setId($value)
2646
2658
}
2647
2659
2648
2660
/**
2661
+ * Get Product Link Repository
2662
+ *
2649
2663
* @return ProductLinkRepositoryInterface
2650
2664
*/
2651
2665
private function getLinkRepository ()
@@ -2658,6 +2672,8 @@ private function getLinkRepository()
2658
2672
}
2659
2673
2660
2674
/**
2675
+ * Get Media Gallery Processor
2676
+ *
2661
2677
* @return Product\Gallery\Processor
2662
2678
*/
2663
2679
private function getMediaGalleryProcessor ()
0 commit comments