Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Attributes
ArrayPool Class Reference

Public Member Functions

 __construct (\Magento\Framework\ObjectManagerInterface $objectManager)
 
 get ($model)
 

Protected Attributes

 $_objectManager
 

Detailed Description

Array optioned object factory

Definition at line 11 of file ArrayPool.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( \Magento\Framework\ObjectManagerInterface  $objectManager)
Parameters
\Magento\Framework\ObjectManagerInterface$objectManager

Definition at line 21 of file ArrayPool.php.

22  {
23  $this->_objectManager = $objectManager;
24  }
$objectManager
Definition: bootstrap.php:17

Member Function Documentation

◆ get()

get (   $model)

Get array optioned object

Parameters
string$model
Exceptions

Definition at line 33 of file ArrayPool.php.

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  }

Field Documentation

◆ $_objectManager

$_objectManager
protected

Definition at line 16 of file ArrayPool.php.


The documentation for this class was generated from the following file: