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
AddressRegistry.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Customer\Model
;
8
9
use
Magento\Framework\Exception\NoSuchEntityException
;
10
14
class
AddressRegistry
15
{
19
protected
$registry
= [];
20
24
protected
$addressFactory
;
25
29
public
function
__construct
(AddressFactory
$addressFactory
)
30
{
31
$this->addressFactory =
$addressFactory
;
32
}
33
41
public
function
retrieve
($addressId)
42
{
43
if
(isset($this->registry[$addressId])) {
44
return
$this->registry[$addressId];
45
}
46
$address
= $this->addressFactory->create();
47
$address
->load($addressId);
48
if
(!
$address
->getId()) {
49
throw
NoSuchEntityException::singleField
(
'addressId'
, $addressId);
50
}
51
$this->registry[$addressId] =
$address
;
52
return
$address
;
53
}
54
61
public
function
remove
($addressId)
62
{
63
unset($this->registry[$addressId]);
64
}
65
72
public
function
push
(
Address
$address
)
73
{
74
$this->registry[
$address
->getId()] =
$address
;
75
return
$this;
76
}
77
}
Magento\Customer\Model\AddressRegistry\retrieve
retrieve($addressId)
Definition:
AddressRegistry.php:41
Magento\Customer\Model\AddressRegistry\push
push(Address $address)
Definition:
AddressRegistry.php:72
Magento\Customer\Model\AddressRegistry\$addressFactory
$addressFactory
Definition:
AddressRegistry.php:24
Magento\Customer\Model\AddressRegistry\$registry
$registry
Definition:
AddressRegistry.php:19
$address
$address
Definition:
customer.php:38
Magento\Framework\Exception\NoSuchEntityException\singleField
static singleField($fieldName, $fieldValue)
Definition:
NoSuchEntityException.php:48
Magento\Customer\Model\AddressRegistry\__construct
__construct(AddressFactory $addressFactory)
Definition:
AddressRegistry.php:29
Magento\Customer\Model\Address
Definition:
Address.php:23
Magento\Customer\Model\AddressRegistry
Definition:
AddressRegistry.php:14
Magento\Customer\Model
Definition:
AccountManagementTest.php:7
Magento\Framework\Exception\NoSuchEntityException
Definition:
NoSuchEntityException.php:16