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 (ObjectManagerInterface $objectManager, AdapterFactory $adapterFactory)
 
 create ($fileName=null, $adapterName=null)
 

Protected Attributes

 $objectManager
 
 $adapterFactory
 

Detailed Description

Definition at line 11 of file Factory.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( ObjectManagerInterface  $objectManager,
AdapterFactory  $adapterFactory 
)
Parameters
ObjectManagerInterface$objectManager
AdapterFactory$adapterFactory

Definition at line 27 of file Factory.php.

30  {
31  $this->objectManager = $objectManager;
32  $this->adapterFactory = $adapterFactory;
33  }

Member Function Documentation

◆ create()

create (   $fileName = null,
  $adapterName = null 
)

Create instance of \Magento\Framework\Image

Parameters
string | null$fileName
string | null$adapterName
Returns
\Magento\Framework\Image

Definition at line 42 of file Factory.php.

43  {
44  $adapter = $this->adapterFactory->create($adapterName);
45  return $this->objectManager->create(
46  \Magento\Framework\Image::class,
47  ['adapter' => $adapter, 'fileName' => $fileName]
48  );
49  }
$adapter
Definition: webapi_user.php:16
$fileName
Definition: translate.phtml:15

Field Documentation

◆ $adapterFactory

$adapterFactory
protected

Definition at line 21 of file Factory.php.

◆ $objectManager

$objectManager
protected

Definition at line 16 of file Factory.php.


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