Skip to content

Commit df3b748

Browse files
author
Vitaliy
authored
Merge pull request #587 from eduard13/eav-generators-improvements-2
Fixing the EAV selected scope for the generated attributes
2 parents 83c9bd0 + 077c19a commit df3b748

File tree

8 files changed

+3
-16
lines changed

8 files changed

+3
-16
lines changed

resources/fileTemplates/internal/Magento Eav Attribute Data Patch Class.php.ft

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ class ${CLASS_NAME} implements ${IMPLEMENTS} {
4040
* means run PatchInterface::revert()
4141
*
4242
* If we speak about data, under revert means: $transaction->rollback()
43-
*
44-
* @return $this
4543
*/
4644
public function apply()
4745
{

src/com/magento/idea/magento2plugin/actions/generation/dialog/util/eavdialog/AttributeUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public static String getSourceClassBySelectedItem(
5454
*/
5555
public static String getScopeClassBySelectedItem(final ComboBoxItemData selectedScopeItem) {
5656
if (selectedScopeItem != null) {
57-
selectedScopeItem.getKey().trim();
57+
return selectedScopeItem.getKey().trim();
5858
}
5959

6060
return AttributeScope.GLOBAL.getScope();

testData/actions/generation/generator/CategoryAttributePropertySetupPatchGenerator/generateFile/AddTestAttributeCategoryAttribute.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Foo\Bar\Setup\Patch\Data;
44

5+
use Magento\Catalog\Model\Category;
56
use Magento\Eav\Setup\EavSetup;
67
use Magento\Eav\Setup\EavSetupFactory;
78
use Magento\Framework\Setup\ModuleDataSetupInterface;
@@ -39,16 +40,14 @@ public function __construct(
3940
* means run PatchInterface::revert()
4041
*
4142
* If we speak about data, under revert means: $transaction->rollback()
42-
*
43-
* @return $this
4443
*/
4544
public function apply()
4645
{
4746
/** @var EavSetup $eavSetup */
4847
$eavSetup = $this->eavSetupFactory->create(['setup' => $this->moduleDataSetup]);
4948

5049
$eavSetup->addAttribute(
51-
\Magento\Catalog\Model\Category::ENTITY,
50+
Category::ENTITY,
5251
'test_attribute',
5352
[
5453
'input' => 'text',

testData/actions/generation/generator/ProductAttributePropertySetupPatchGenerator/generateFile/AddTestAttribute.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ public function __construct(
4040
* means run PatchInterface::revert()
4141
*
4242
* If we speak about data, under revert means: $transaction->rollback()
43-
*
44-
* @return $this
4543
*/
4644
public function apply()
4745
{

testData/actions/generation/generator/ProductAttributePropertySetupPatchGenerator/generateFileWithApplyToAttribute/AddAppliedToAttribute.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ public function __construct(
4040
* means run PatchInterface::revert()
4141
*
4242
* If we speak about data, under revert means: $transaction->rollback()
43-
*
44-
* @return $this
4543
*/
4644
public function apply()
4745
{

testData/actions/generation/generator/ProductAttributePropertySetupPatchGenerator/generateFileWithBooleanSourceModel/AddBooleanInputAttributeAttribute.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ public function __construct(
4040
* means run PatchInterface::revert()
4141
*
4242
* If we speak about data, under revert means: $transaction->rollback()
43-
*
44-
* @return $this
4543
*/
4644
public function apply()
4745
{

testData/actions/generation/generator/ProductAttributePropertySetupPatchGenerator/generateFileWithGeneratedSourceModel/AddAttributeWithCustomSourceAttribute.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ public function __construct(
4040
* means run PatchInterface::revert()
4141
*
4242
* If we speak about data, under revert means: $transaction->rollback()
43-
*
44-
* @return $this
4543
*/
4644
public function apply()
4745
{

testData/actions/generation/generator/ProductAttributePropertySetupPatchGenerator/generateFileWithOptions/AddAttributeWithOptionsAttribute.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ public function __construct(
4040
* means run PatchInterface::revert()
4141
*
4242
* If we speak about data, under revert means: $transaction->rollback()
43-
*
44-
* @return $this
4543
*/
4644
public function apply()
4745
{

0 commit comments

Comments
 (0)