Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
GroupId.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Mtf\Fixture\DataSource;
10 use Magento\Mtf\Fixture\FixtureFactory;
12 
16 class GroupId extends DataSource
17 {
24 
31  public function __construct(FixtureFactory $fixtureFactory, array $params, array $data = [])
32  {
33  $this->params = $params;
34  if (isset($data['dataset'])) {
36  $customerGroup = $fixtureFactory->createByCode('customerGroup', ['dataset' => $data['dataset']]);
37  if (!$customerGroup->hasData('customer_group_id')) {
38  $customerGroup->persist();
39  }
40  $this->data = $customerGroup->getCustomerGroupCode();
41  $this->customerGroupFixture = $customerGroup;
42  }
43  if (isset($data['customerGroup']) && $data['customerGroup'] instanceof CustomerGroup) {
44  $this->data = $data['customerGroup']->getCustomerGroupCode();
45  $this->customerGroupFixture = $data['customerGroup'];
46  }
47  if (isset($data['value'])) {
48  $this->data = $data['value'];
49  }
50  }
51 
57  public function getCustomerGroup()
58  {
60  }
61 }
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE]
Definition: website.php:18