Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-customer
Model
GroupRegistry.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Customer\Model
;
8
9
use
Magento\Customer\Api\Data\GroupInterface
;
10
use
Magento\Framework\Exception\NoSuchEntityException
;
11
15
class
GroupRegistry
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
) {
50
throw
NoSuchEntityException::singleField
(
GroupInterface::ID
,
$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
}
Magento\Customer\Model\GroupRegistry\$registry
$registry
Definition:
GroupRegistry.php:20
Magento\Customer\Model\GroupRegistry\__construct
__construct(GroupFactory $groupFactory)
Definition:
GroupRegistry.php:30
Magento\Customer\Model\GroupRegistry
Definition:
GroupRegistry.php:15
$group
$group
Definition:
sections.phtml:16
Magento\Customer\Model\GroupRegistry\$groupFactory
$groupFactory
Definition:
GroupRegistry.php:25
Magento\Framework\Exception\NoSuchEntityException\singleField
static singleField($fieldName, $fieldValue)
Definition:
NoSuchEntityException.php:48
$groupId
$groupId
Definition:
filterable_attributes.php:14
Magento\Customer\Model\GroupRegistry\retrieve
retrieve($groupId)
Definition:
GroupRegistry.php:42
Magento\Customer\Api\Data\GroupInterface\ID
const ID
Definition:
GroupInterface.php:22
Magento\Customer\Model
Definition:
AccountManagementTest.php:7
Magento\Customer\Api\Data\GroupInterface
Definition:
GroupInterface.php:17
Magento\Framework\Exception\NoSuchEntityException
Definition:
NoSuchEntityException.php:16