Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
EntityId.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Mtf\Fixture\DataSource;
10 use Magento\Mtf\Fixture\FixtureFactory;
11 use Magento\Mtf\Fixture\FixtureInterface;
12 
16 class EntityId extends DataSource
17 {
23  protected $entity = null;
24 
31  public function __construct(FixtureFactory $fixtureFactory, array $params, array $data = [])
32  {
33  $this->params = $params;
34 
35  if (isset($data['dataset'])) {
36  list($typeFixture, $dataset) = explode('::', $data['dataset']);
37  $fixture = $fixtureFactory->createByCode($typeFixture, ['dataset' => $dataset]);
38  if (!$fixture->hasData('id')) {
39  $fixture->persist();
40  }
41 
42  $this->entity = $fixture;
43  $this->data = $fixture->getId();
44  }
45  }
46 
52  public function getEntity()
53  {
54  return $this->entity;
55  }
56 }
__construct(FixtureFactory $fixtureFactory, array $params, array $data=[])
Definition: EntityId.php:31
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE]
Definition: website.php:18