Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ArrayPool.php
Go to the documentation of this file.
1 <?php
7 
11 class ArrayPool
12 {
16  protected $_objectManager;
17 
22  {
23  $this->_objectManager = $objectManager;
24  }
25 
33  public function get($model)
34  {
35  $modelInstance = $this->_objectManager->get($model);
36  if (false == $modelInstance instanceof \Magento\Framework\Option\ArrayInterface) {
37  throw new \InvalidArgumentException($model . 'doesn\'t implement \Magento\Framework\Option\ArrayInterface');
38  }
39  return $modelInstance;
40  }
41 }
$objectManager
Definition: bootstrap.php:17
__construct(\Magento\Framework\ObjectManagerInterface $objectManager)
Definition: ArrayPool.php:21