Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
GroupRegistry.php
Go to the documentation of this file.
1 <?php
7 namespace Magento\Customer\Model;
8 
11 
16 {
20  protected $registry = [];
21 
25  protected $groupFactory;
26 
30  public function __construct(GroupFactory $groupFactory)
31  {
32  $this->groupFactory = $groupFactory;
33  }
34 
42  public function retrieve($groupId)
43  {
44  if (isset($this->registry[$groupId])) {
45  return $this->registry[$groupId];
46  }
47  $group = $this->groupFactory->create();
48  $group->load($groupId);
49  if ($group->getId() === null || $group->getId() != $groupId) {
51  }
52  $this->registry[$groupId] = $group;
53  return $group;
54  }
55 
62  public function remove($groupId)
63  {
64  unset($this->registry[$groupId]);
65  }
66 }
__construct(GroupFactory $groupFactory)
$group
Definition: sections.phtml:16