Skip to content

Commit 50ae37e

Browse files
author
Stanislav Idolov
committed
magento-engcom/magento2ce#2216 Fixed test failures
1 parent d9208cf commit 50ae37e

File tree

4 files changed

+99
-48
lines changed

4 files changed

+99
-48
lines changed

app/code/Magento/Catalog/Model/Product.php

Lines changed: 40 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -498,8 +498,9 @@ protected function _getResource()
498498
}
499499

500500
/**
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 for product will return all product attribute codes
503504
*
504505
* @return string[]
505506
*/
@@ -584,8 +585,9 @@ public function getPrice()
584585
}
585586

586587
/**
587-
* @codeCoverageIgnoreStart
588588
* Get visibility status
589+
*
590+
* @codeCoverageIgnoreStart
589591
* @see \Magento\Catalog\Model\Product\Visibility
590592
*
591593
* @return int
@@ -662,6 +664,7 @@ public function getStatus()
662664

663665
/**
664666
* Retrieve type instance of the product.
667+
*
665668
* Type instance implements product type depended logic and is a singleton shared by all products of the same type.
666669
*
667670
* @return \Magento\Catalog\Model\Product\Type\AbstractType
@@ -822,9 +825,10 @@ public function getStoreIds()
822825

823826
/**
824827
* Retrieve product attributes
825-
* if $groupId is null - retrieve all product attributes
826828
*
827-
* @param int $groupId Retrieve attributes of the specified group
829+
* If $groupId is null - retrieve all product attributes
830+
*
831+
* @param int $groupId Retrieve attributes of the specified group
828832
* @param bool $skipSuper Not used
829833
* @return \Magento\Eav\Model\Entity\Attribute\AbstractAttribute[]
830834
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
@@ -916,6 +920,7 @@ public function beforeSave()
916920

917921
/**
918922
* Check/set if options can be affected when saving product
923+
*
919924
* If value specified, it will be set.
920925
*
921926
* @param bool $value
@@ -1036,6 +1041,7 @@ public function reindex()
10361041

10371042
/**
10381043
* Clear cache related with product and protect delete from not admin
1044+
*
10391045
* Register indexing event before delete product
10401046
*
10411047
* @return \Magento\Catalog\Model\Product
@@ -1545,11 +1551,11 @@ public function hasGalleryAttribute()
15451551
/**
15461552
* Add image to media gallery
15471553
*
1548-
* @param string $file file path of image in file system
1549-
* @param string|array $mediaAttribute code of attribute with type 'media_image',
1550-
* leave blank if image should be only in gallery
1551-
* @param boolean $move if true, it will move source file
1552-
* @param boolean $exclude mark image as disabled in product page view
1554+
* @param string $file file path of image in file system
1555+
* @param string|array $mediaAttribute code of attribute with type 'media_image',
1556+
* leave blank if image should be only in gallery
1557+
* @param bool $move if true, it will move source file
1558+
* @param bool $exclude mark image as disabled in product page view
15531559
* @return \Magento\Catalog\Model\Product
15541560
*/
15551561
public function addImageToMediaGallery($file, $mediaAttribute = null, $move = false, $exclude = true)
@@ -1711,6 +1717,7 @@ public function getIsSalable()
17111717

17121718
/**
17131719
* Check is a virtual product
1720+
*
17141721
* Data helper wrapper
17151722
*
17161723
* @return bool
@@ -1803,9 +1810,9 @@ public function formatUrlKey($str)
18031810
/**
18041811
* Save current attribute with code $code and assign new value
18051812
*
1806-
* @param string $code Attribute code
1807-
* @param mixed $value New attribute value
1808-
* @param int $store Store ID
1813+
* @param string $code Attribute code
1814+
* @param mixed $value New attribute value
1815+
* @param int $store Store ID
18091816
* @return void
18101817
*/
18111818
public function addAttributeUpdate($code, $value, $store)
@@ -1875,6 +1882,7 @@ public function getRequestPath()
18751882

18761883
/**
18771884
* Custom function for other modules
1885+
*
18781886
* @return string
18791887
*/
18801888
public function getGiftMessageAvailable()
@@ -1993,6 +2001,8 @@ public function getOptions()
19932001
}
19942002

19952003
/**
2004+
* Set product options
2005+
*
19962006
* @param \Magento\Catalog\Api\Data\ProductCustomOptionInterface[] $options
19972007
* @return $this
19982008
*/
@@ -2016,10 +2026,10 @@ public function getIsVirtual()
20162026
/**
20172027
* Add custom option information to product
20182028
*
2019-
* @param string $code Option code
2020-
* @param mixed $value Value of the option
2021-
* @param int|Product $product Product ID
2022-
* @return $this
2029+
* @param string $code Option code
2030+
* @param mixed $value Value of the option
2031+
* @param int|Product $product Product ID
2032+
* @return $this
20232033
*/
20242034
public function addCustomOption($code, $value, $product = null)
20252035
{
@@ -2213,6 +2223,7 @@ public function getPreconfiguredValues()
22132223

22142224
/**
22152225
* Prepare product custom options.
2226+
*
22162227
* To be sure that all product custom options does not has ID and has product instance
22172228
*
22182229
* @return \Magento\Catalog\Model\Product
@@ -2547,7 +2558,7 @@ public function setTypeId($typeId)
25472558
}
25482559

25492560
/**
2550-
* {@inheritdoc}
2561+
* @inheritdoc
25512562
*
25522563
* @return \Magento\Catalog\Api\Data\ProductExtensionInterface
25532564
*/
@@ -2557,7 +2568,7 @@ public function getExtensionAttributes()
25572568
}
25582569

25592570
/**
2560-
* {@inheritdoc}
2571+
* @inheritdoc
25612572
*
25622573
* @param \Magento\Catalog\Api\Data\ProductExtensionInterface $extensionAttributes
25632574
* @return $this
@@ -2570,6 +2581,8 @@ public function setExtensionAttributes(\Magento\Catalog\Api\Data\ProductExtensio
25702581
//@codeCoverageIgnoreEnd
25712582

25722583
/**
2584+
* Convert array to media gallery interface
2585+
*
25732586
* @param array $mediaGallery
25742587
* @return \Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterface[]
25752588
*/
@@ -2587,6 +2600,8 @@ protected function convertToMediaGalleryInterface(array $mediaGallery)
25872600
}
25882601

25892602
/**
2603+
* Returns media gallery entries
2604+
*
25902605
* @return \Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterface[]|null
25912606
*/
25922607
public function getMediaGalleryEntries()
@@ -2601,6 +2616,8 @@ public function getMediaGalleryEntries()
26012616
}
26022617

26032618
/**
2619+
* Set media gallery entries
2620+
*
26042621
* @param ProductAttributeMediaGalleryEntryInterface[] $mediaGalleryEntries
26052622
* @return $this
26062623
*/
@@ -2643,6 +2660,8 @@ public function setId($value)
26432660
}
26442661

26452662
/**
2663+
* Returns link repository instance
2664+
*
26462665
* @return ProductLinkRepositoryInterface
26472666
*/
26482667
private function getLinkRepository()
@@ -2655,6 +2674,8 @@ private function getLinkRepository()
26552674
}
26562675

26572676
/**
2677+
* Returns media gallery processor instance
2678+
*
26582679
* @return Product\Gallery\Processor
26592680
*/
26602681
private function getMediaGalleryProcessor()

0 commit comments

Comments
 (0)