Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
InterceptionCache.php
Go to the documentation of this file.
1 <?php
7 
9 
11 {
15  private $data = [];
16 
20  private $configInterface;
21 
25  private $interceptionsInstancesNamesList;
26 
32  public function __construct(
33  \Magento\Framework\Interception\Config\Config $configInterface,
34  \Magento\Setup\Module\Di\Code\Reader\Decorator\Interceptions $interceptionsInstancesNamesList,
35  array $data = []
36  ) {
37  $this->configInterface = $configInterface;
38  $this->interceptionsInstancesNamesList = $interceptionsInstancesNamesList;
39  $this->data = $data;
40  }
41 
47  public function doOperation()
48  {
49  if (empty($this->data)) {
50  return;
51  }
52 
53  $definitions = [];
54  foreach ($this->data as $paths) {
55  if (!is_array($paths)) {
56  $paths = (array)$paths;
57  }
58  foreach ($paths as $path) {
59  $definitions = array_merge($definitions, $this->interceptionsInstancesNamesList->getList($path));
60  }
61  }
62 
63  $this->configInterface->initialize($definitions);
64  }
65 
71  public function getName()
72  {
73  return 'Interception cache generation';
74  }
75 }
__construct(\Magento\Framework\Interception\Config\Config $configInterface, \Magento\Setup\Module\Di\Code\Reader\Decorator\Interceptions $interceptionsInstancesNamesList, array $data=[])
$paths
Definition: _bootstrap.php:83