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

Public Member Functions

 __construct (\Magento\Framework\ObjectManagerInterface $objectManager)
 
 create ($className, $data=[])
 

Protected Attributes

 $_objectManager
 

Detailed Description

Persistent Factory

Definition at line 11 of file Factory.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( \Magento\Framework\ObjectManagerInterface  $objectManager)

Construct

Parameters
\Magento\Framework\ObjectManagerInterface$objectManager

Definition at line 25 of file Factory.php.

26  {
27  $this->_objectManager = $objectManager;
28  }
$objectManager
Definition: bootstrap.php:17

Member Function Documentation

◆ create()

create (   $className,
  $data = [] 
)

Creates models

Parameters
string$className
array$data
Returns
mixed

Definition at line 37 of file Factory.php.

38  {
39  return $this->_objectManager->create($className, $data);
40  }
if($currentSelectedMethod==$_code) $className
Definition: form.phtml:31

Field Documentation

◆ $_objectManager

$_objectManager
protected

Definition at line 18 of file Factory.php.


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