Skip to content

Commit 5e5213a

Browse files
author
Bryant Luk
committed
MAGETWO-36064: Add ACL configuration to CatalogInventory attributes of the ProductInterface
- Cherry-pick commit where extension attributes are made optional
1 parent 148cd4c commit 5e5213a

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

lib/internal/Magento/Framework/Api/Code/Generator/ExtensionAttributesGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ protected function _getClassMethods()
8888
$methods[] = [
8989
'name' => $getterName,
9090
'body' => "return \$this->_get('{$attributeName}');",
91-
'docblock' => ['tags' => [['name' => 'return', 'description' => $attributeType]]],
91+
'docblock' => ['tags' => [['name' => 'return', 'description' => $attributeType . '|null']]],
9292
];
9393
$methods[] = [
9494
'name' => $setterName,

lib/internal/Magento/Framework/Api/Test/Unit/Code/Generator/_files/SampleExtension.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace Magento\Catalog\Api\Data;
66
class ProductExtension extends \Magento\Framework\Api\AbstractSimpleObject implements \Magento\Catalog\Api\Data\ProductExtensionInterface
77
{
88
/**
9-
* @return string
9+
* @return string|null
1010
*/
1111
public function getStringAttribute()
1212
{
@@ -24,7 +24,7 @@ class ProductExtension extends \Magento\Framework\Api\AbstractSimpleObject imple
2424
}
2525

2626
/**
27-
* @return \Magento\Bundle\Api\Data\OptionInterface[]
27+
* @return \Magento\Bundle\Api\Data\OptionInterface[]|null
2828
*/
2929
public function getComplexObjectAttribute()
3030
{

lib/internal/Magento/Framework/Api/Test/Unit/Code/Generator/_files/SampleExtensionInterface.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace Magento\Catalog\Api\Data;
66
interface ProductExtensionInterface extends \Magento\Framework\Api\ExtensionAttributesInterface
77
{
88
/**
9-
* @return string
9+
* @return string|null
1010
*/
1111
public function getStringAttribute();
1212

@@ -17,7 +17,7 @@ interface ProductExtensionInterface extends \Magento\Framework\Api\ExtensionAttr
1717
public function setStringAttribute($stringAttribute);
1818

1919
/**
20-
* @return \Magento\Bundle\Api\Data\OptionInterface[]
20+
* @return \Magento\Bundle\Api\Data\OptionInterface[]|null
2121
*/
2222
public function getComplexObjectAttribute();
2323

0 commit comments

Comments
 (0)