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

Public Member Functions

 __construct (\Magento\Framework\ObjectManagerInterface $objectManager)
 
 createAttribute ($className, $arguments=[])
 

Protected Attributes

 $_objectManager
 

Detailed Description

EAV attribute model factory

@api @codeCoverageIgnore

Since
100.0.2

Definition at line 15 of file AttributeFactory.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 25 of file AttributeFactory.php.

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

Member Function Documentation

◆ createAttribute()

createAttribute (   $className,
  $arguments = [] 
)

Create new Eav attribute instance

Parameters
string$className
array$arguments
Returns
mixed

Definition at line 37 of file AttributeFactory.php.

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

Field Documentation

◆ $_objectManager

$_objectManager
protected

Definition at line 20 of file AttributeFactory.php.


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