Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit d8e26d8

Browse files
author
Magento CICD
authored
merge magento/2.3-develop into magento-pangolin/MQE-727-MSI-PR
2 parents 97c8f81 + fb6b529 commit d8e26d8

File tree

56 files changed

+1826
-443
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1826
-443
lines changed

.php_cs.dist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
*/
66

77
/**
8-
* Pre-commit hook installation:
9-
* vendor/bin/static-review.php hook:install dev/tools/Magento/Tools/StaticReview/pre-commit .git/hooks/pre-commit
8+
* PHP Coding Standards fixer configuration
109
*/
10+
1111
$finder = PhpCsFixer\Finder::create()
1212
->name('*.phtml')
1313
->exclude('dev/tests/functional/generated')

app/code/Magento/Catalog/Api/Data/ProductAttributeInterface.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,9 @@ interface ProductAttributeInterface extends \Magento\Catalog\Api\Data\EavAttribu
3232
const CODE_TIER_PRICE_FIELD_VALUE_TYPE = 'value_type';
3333
const CODE_SEO_FIELD_META_DESCRIPTION = 'meta_description';
3434
const CODE_WEIGHT = 'weight';
35+
36+
/**
37+
* @return \Magento\Eav\Api\Data\AttributeExtensionInterface|null
38+
*/
39+
public function getExtensionAttributes();
3540
}

app/code/Magento/Catalog/Block/Product/ImageBuilder.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
namespace Magento\Catalog\Block\Product;
77

88
use Magento\Catalog\Helper\ImageFactory as HelperFactory;
9+
use Magento\Catalog\Model\Product;
910
use Magento\Catalog\Model\Product\Image\NotLoadInfoImageException;
1011

1112
class ImageBuilder
@@ -21,7 +22,7 @@ class ImageBuilder
2122
protected $helperFactory;
2223

2324
/**
24-
* @var \Magento\Catalog\Model\Product
25+
* @var Product
2526
*/
2627
protected $product;
2728

@@ -50,10 +51,10 @@ public function __construct(
5051
/**
5152
* Set product
5253
*
53-
* @param \Magento\Catalog\Model\Product $product
54+
* @param Product $product
5455
* @return $this
5556
*/
56-
public function setProduct(\Magento\Catalog\Model\Product $product)
57+
public function setProduct(Product $product)
5758
{
5859
$this->product = $product;
5960
return $this;
@@ -79,9 +80,7 @@ public function setImageId($imageId)
7980
*/
8081
public function setAttributes(array $attributes)
8182
{
82-
if ($attributes) {
83-
$this->attributes = $attributes;
84-
}
83+
$this->attributes = $attributes;
8584
return $this;
8685
}
8786

app/code/Magento/Catalog/Model/Product/Attribute/Source/Inputtype.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,16 @@ class Inputtype extends \Magento\Eav\Model\Adminhtml\System\Config\Source\Inputt
2828
/**
2929
* @param \Magento\Framework\Event\ManagerInterface $eventManager
3030
* @param \Magento\Framework\Registry $coreRegistry
31+
* @param array $optionsArray
3132
*/
3233
public function __construct(
3334
\Magento\Framework\Event\ManagerInterface $eventManager,
34-
\Magento\Framework\Registry $coreRegistry
35+
\Magento\Framework\Registry $coreRegistry,
36+
array $optionsArray = []
3537
) {
3638
$this->_eventManager = $eventManager;
3739
$this->_coreRegistry = $coreRegistry;
40+
parent::__construct($optionsArray);
3841
}
3942

4043
/**

app/code/Magento/Catalog/Model/ResourceModel/Eav/Attribute.php

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
* @method int setSearchWeight(int $value)
2222
* @method bool getIsUsedForPriceRules()
2323
* @method int setIsUsedForPriceRules(int $value)
24-
* @method \Magento\Eav\Api\Data\AttributeExtensionInterface getExtensionAttributes()
2524
*
2625
* @author Magento Core Team <[email protected]>
2726
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
@@ -80,6 +79,11 @@ class Attribute extends \Magento\Eav\Model\Entity\Attribute implements
8079
*/
8180
protected $_indexerEavProcessor;
8281

82+
/**
83+
* @var \Magento\Eav\Api\Data\AttributeExtensionFactory
84+
*/
85+
private $eavAttributeFactory;
86+
8387
/**
8488
* @param \Magento\Framework\Model\Context $context
8589
* @param \Magento\Framework\Registry $registry
@@ -101,9 +105,10 @@ class Attribute extends \Magento\Eav\Model\Entity\Attribute implements
101105
* @param \Magento\Catalog\Model\Indexer\Product\Eav\Processor $indexerEavProcessor
102106
* @param \Magento\Catalog\Helper\Product\Flat\Indexer $productFlatIndexerHelper
103107
* @param LockValidatorInterface $lockValidator
104-
* @param \Magento\Framework\Model\ResourceModel\AbstractResource $resource
105-
* @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection
108+
* @param \Magento\Framework\Model\ResourceModel\AbstractResource|null $resource
109+
* @param \Magento\Framework\Data\Collection\AbstractDb|null $resourceCollection
106110
* @param array $data
111+
* @param \Magento\Eav\Api\Data\AttributeExtensionFactory|null $eavAttributeFactory
107112
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
108113
*/
109114
public function __construct(
@@ -129,12 +134,15 @@ public function __construct(
129134
LockValidatorInterface $lockValidator,
130135
\Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
131136
\Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
132-
array $data = []
137+
array $data = [],
138+
\Magento\Eav\Api\Data\AttributeExtensionFactory $eavAttributeFactory = null
133139
) {
134140
$this->_indexerEavProcessor = $indexerEavProcessor;
135141
$this->_productFlatIndexerProcessor = $productFlatIndexerProcessor;
136142
$this->_productFlatIndexerHelper = $productFlatIndexerHelper;
137143
$this->attrLockValidator = $lockValidator;
144+
$this->eavAttributeFactory = $eavAttributeFactory ?: \Magento\Framework\App\ObjectManager::getInstance()
145+
->get(\Magento\Eav\Api\Data\AttributeExtensionFactory::class);
138146
parent::__construct(
139147
$context,
140148
$registry,
@@ -887,4 +895,18 @@ public function setIsFilterableInGrid($isFilterableInGrid)
887895
$this->setData(self::IS_FILTERABLE_IN_GRID, $isFilterableInGrid);
888896
return $this;
889897
}
898+
899+
/**
900+
* @return \Magento\Eav\Api\Data\AttributeExtensionInterface
901+
*/
902+
public function getExtensionAttributes()
903+
{
904+
$extensionAttributes = $this->_getExtensionAttributes();
905+
if (null === $extensionAttributes) {
906+
/** @var \Magento\Eav\Api\Data\AttributeExtensionInterface $extensionAttributes */
907+
$extensionAttributes = $this->eavAttributeFactory->create();
908+
$this->setExtensionAttributes($extensionAttributes);
909+
}
910+
return $extensionAttributes;
911+
}
890912
}

0 commit comments

Comments
 (0)