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 
12 {
19  public function getFields(\Magento\Framework\DataObject $entity)
20  {
21  $entityClass = get_class($entity);
22  if (!isset($this->metadataInfo[$entityClass])) {
23  $fields = $entity->getResource()->getConnection()->describeTable(
24  $entity->getResource()->getEntityTable()
25  );
26 
27  $fields = array_merge($fields, $entity->getAttributes());
28 
29  $fields = array_fill_keys(
30  array_keys($fields),
31  null
32  );
33 
34  $this->metadataInfo[$entityClass] = $fields;
35  }
36 
37  return $this->metadataInfo[$entityClass];
38  }
39 }
$fields
Definition: details.phtml:14
getFields(\Magento\Framework\DataObject $entity)
Definition: Metadata.php:19
$entity
Definition: element.phtml:22