Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Factory.php
Go to the documentation of this file.
1 <?php
8 
10 
11 class Factory
12 {
16  protected $objectManager;
17 
21  protected $adapterFactory;
22 
27  public function __construct(
30  ) {
31  $this->objectManager = $objectManager;
32  $this->adapterFactory = $adapterFactory;
33  }
34 
42  public function create($fileName = null, $adapterName = null)
43  {
44  $adapter = $this->adapterFactory->create($adapterName);
45  return $this->objectManager->create(
46  \Magento\Framework\Image::class,
47  ['adapter' => $adapter, 'fileName' => $fileName]
48  );
49  }
50 }
__construct(ObjectManagerInterface $objectManager, AdapterFactory $adapterFactory)
Definition: Factory.php:27
create($fileName=null, $adapterName=null)
Definition: Factory.php:42
$adapter
Definition: webapi_user.php:16
$fileName
Definition: translate.phtml:15