Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
StoreIds.php
Go to the documentation of this file.
1 <?php
8 
10 use Magento\Mtf\Fixture\FixtureFactory;
11 use Magento\Mtf\Fixture\DataSource;
12 
16 class StoreIds extends DataSource
17 {
23  protected $stores = [];
24 
31  public function __construct(FixtureFactory $fixtureFactory, array $params, array $data = [])
32  {
33  $this->params = $params;
34  if (isset($data['dataset'])) {
35  $dataset = explode(',', $data['dataset']);
36  foreach ($dataset as $store) {
38  $store = $fixtureFactory->createByCode('store', ['dataset' => $store]);
39  if (!$store->hasData('store_id')) {
40  $store->persist();
41  }
42  $this->stores[] = $store;
43  $this->data[] = $store->getName();
44  }
45  } else {
46  $this->data[] = null;
47  }
48  }
49 
55  public function getStores()
56  {
57  return $this->stores;
58  }
59 }
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE]
Definition: website.php:18