Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
magento2-base
dev
tests
functional
tests
app
Magento
Catalog
Test
Fixture
Product
AttributeSetId.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Catalog\Test\Fixture\Product
;
8
9
use Magento\Mtf\Fixture\DataSource;
10
use Magento\Mtf\Fixture\FixtureFactory;
11
use
Magento\Catalog\Test\Fixture\CatalogAttributeSet
;
12
20
class
AttributeSetId
extends
DataSource
21
{
27
protected
$attributeSet
;
28
35
public
function
__construct(FixtureFactory $fixtureFactory, array
$params
,
$data
= [])
36
{
37
$this->params =
$params
;
38
if
(isset(
$data
[
'dataset'
]) &&
$data
[
'dataset'
] !==
'Default'
) {
40
$attributeSet
= $fixtureFactory->createByCode(
'catalogAttributeSet'
, [
'dataset'
=>
$data
[
'dataset'
]]);
41
if
(!
$attributeSet
->hasData(
'attribute_set_id'
)) {
42
$attributeSet
->persist();
43
}
44
}
45
if
(isset(
$data
[
'attribute_set'
]) &&
$data
[
'attribute_set'
] instanceof CatalogAttributeSet) {
46
$attributeSet
=
$data
[
'attribute_set'
];
47
}
48
if
(!isset(
$data
[
'dataset'
]) && !isset(
$data
[
'attribute_set'
])) {
49
$this->data =
$data
;
50
}
else
{
52
$this->data =
$attributeSet
->getAttributeSetName();
53
$this->attributeSet =
$attributeSet
;
54
}
55
}
56
62
public
function
getAttributeSet
()
63
{
64
return
$this->attributeSet
;
65
}
66
}
Magento\Catalog\Test\Fixture\Product\AttributeSetId
Definition:
AttributeSetId.php:20
$data
$data
Definition:
attribute_set_with_image_attribute.php:16
Magento\Catalog\Test\Fixture\Product\AttributeSetId\$attributeSet
$attributeSet
Definition:
AttributeSetId.php:27
Magento\Catalog\Test\Fixture\CatalogAttributeSet
Definition:
AssignedAttributes.php:7
Magento\Catalog\Test\Fixture\Product\AttributeSetId\getAttributeSet
getAttributeSet()
Definition:
AttributeSetId.php:62
$params
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE]
Definition:
website.php:18
Magento\Catalog\Test\Fixture\Product
Definition:
AttributeSetId.php:7