Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CartItemProcessorsPool.php
Go to the documentation of this file.
1 <?php
7 
10 
15 {
19  private $cartItemProcessors = [];
20 
24  private $objectManagerConfig;
25 
30  public function __construct(ConfigInterface $objectManagerConfig)
31  {
32  $this->objectManagerConfig = $objectManagerConfig;
33  }
34 
39  public function getCartItemProcessors()
40  {
41  if (!empty($this->cartItemProcessors)) {
42  return $this->cartItemProcessors;
43  }
44 
45  $typePreference = $this->objectManagerConfig->getPreference(Repository::class);
46  $arguments = $this->objectManagerConfig->getArguments($typePreference);
47  if (isset($arguments['cartItemProcessors'])) {
48  // Workaround for compiled mode.
49  $processors = isset($arguments['cartItemProcessors']['_vac_'])
50  ? $arguments['cartItemProcessors']['_vac_']
51  : $arguments['cartItemProcessors'];
52  foreach ($processors as $name => $processor) {
53  $className = isset($processor['instance']) ? $processor['instance'] : $processor['_i_'];
54  $this->cartItemProcessors[$name] = ObjectManager::getInstance()->get($className);
55  }
56  }
57 
58  return $this->cartItemProcessors;
59  }
60 }
$processor
Definition: 404.php:10
$arguments
if($currentSelectedMethod==$_code) $className
Definition: form.phtml:31
if(!isset($_GET['name'])) $name
Definition: log.php:14