Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ConfigsApplyFixture.php
Go to the documentation of this file.
1 <?php
7 namespace Magento\Setup\Fixtures;
8 
13 {
17  protected $priority = -1;
18 
22  public function execute()
23  {
24  $configs = $this->fixtureModel->getValue('configs', []);
25  if (empty($configs)) {
26  return;
27  }
28  $this->fixtureModel->resetObjectManager();
29 
30  foreach ($configs['config'] as $config) {
31  $backendModel = isset($config['backend_model'])
32  ?
33  $config['backend_model'] : \Magento\Framework\App\Config\Value::class;
37  $configData = $this->fixtureModel->getObjectManager()->create($backendModel);
38  $configData->setPath($config['path'])
39  ->setScope($config['scope'])
40  ->setScopeId($config['scopeId'])
41  ->setValue($config['value'])
42  ->save();
43  }
44  $this->fixtureModel->getObjectManager()
45  ->get(\Magento\Framework\App\CacheInterface::class)
46  ->clean([\Magento\Framework\App\Config::CACHE_TAG]);
47 
48  $this->fixtureModel->getObjectManager()
49  ->get(\Magento\Config\App\Config\Type\System::class)
50  ->clean();
51  }
52 
56  public function getActionTitle()
57  {
58  return 'Config Changes';
59  }
60 
64  public function introduceParamLabels()
65  {
66  return [];
67  }
68 }
$config
Definition: fraud_order.php:17