Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AbstractState.php
Go to the documentation of this file.
1 <?php
7 
8 use Magento\Mtf\ObjectManager;
9 
13 abstract class AbstractState implements StateInterface
14 {
20  protected $objectManager;
21 
27  private $arguments;
28 
34  protected $isCleanInstance = false;
35 
40  public function __construct(
41  ObjectManager $objectManager,
42  array $arguments = []
43  ) {
44  $this->objectManager = $objectManager;
45  $this->arguments = $arguments;
46  }
47 
51  public function apply()
52  {
53  foreach ($this->arguments as $argument) {
54  $handler = $this->objectManager->get($argument);
55  $handler->execute($this);
56  }
57  if ($this->isCleanInstance) {
58  $this->clearInstance();
59  }
60  }
61 
65  public function clearInstance()
66  {
67  //
68  }
69 }
__construct(ObjectManager $objectManager, array $arguments=[])
catch(\Exception $e) $handler
Definition: index.php:30