Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Metadata.php
Go to the documentation of this file.
1 <?php
7 
11 class Metadata
12 {
16  protected $objectManager;
17 
21  protected $resourceClassName;
22 
26  protected $modelClassName;
27 
33  public function __construct(
37  ) {
38  $this->objectManager = $objectManager;
39  $this->resourceClassName = $resourceClassName;
40  $this->modelClassName = $modelClassName;
41  }
42 
46  public function getMapper()
47  {
48  return $this->objectManager->get($this->resourceClassName);
49  }
50 
54  public function getNewInstance()
55  {
56  return $this->objectManager->create($this->modelClassName);
57  }
58 }
__construct(\Magento\Framework\ObjectManagerInterface $objectManager, $resourceClassName, $modelClassName)
Definition: Metadata.php:33