Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
EntityRegistry.php
Go to the documentation of this file.
1 <?php
8 
13 {
17  protected $registry = [];
18 
27  public function register($entityType, $identifier, $entity)
28  {
29  $this->registry[$entityType][$identifier] = $entity;
30  }
31 
39  public function retrieve($entityType, $identifier)
40  {
41  if (isset($this->registry[$entityType][$identifier])) {
42  return $this->registry[$entityType][$identifier];
43  } else {
44  return null;
45  }
46  }
47 
55  public function remove($entityType, $identifier)
56  {
57  if (isset($this->registry[$entityType][$identifier])) {
58  unset($this->registry[$entityType][$identifier]);
59  }
60  return true;
61  }
62 }
retrieve($entityType, $identifier)
$entity
Definition: element.phtml:22