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
magento2-base
dev
tests
integration
testsuite
Magento
Customer
_files
customer_two_addresses.php
Go to the documentation of this file.
1
<?php
9
use
Magento\Customer\Model\CustomerRegistry
;
10
11
require
'customer_address.php'
;
12
14
$customerAddress
=
\Magento\TestFramework\Helper\Bootstrap::getObjectManager
()
15
->create(\
Magento
\Customer\Model\Address::class);
17
$customerRegistry
=
\Magento\TestFramework\Helper\Bootstrap::getObjectManager
()
18
->get(CustomerRegistry::class);
19
$customerAddress
->isObjectNew(
true
);
20
$customerAddress
->setData(
21
[
22
'entity_id'
=> 2,
23
'attribute_set_id'
=> 2,
24
'telephone'
=> 3234676,
25
'postcode'
=> 47676,
26
'country_id'
=>
'US'
,
27
'city'
=>
'CityX'
,
28
'street'
=> [
'Black str, 48'
],
29
'lastname'
=>
'Smith'
,
30
'firstname'
=>
'John'
,
31
'parent_id'
=> 1,
32
'region_id'
=> 1,
33
]
34
)->setCustomerId(
35
1
36
);
37
38
$customerAddress
->save();
39
$customerRegistry
->remove(
$customerAddress
->getCustomerId());
$customerAddress
$customerAddress
Definition:
customer_two_addresses.php:14
$customerRegistry
$customerRegistry
Definition:
customer_two_addresses.php:17
Magento
Magento\Customer\Model\CustomerRegistry
Definition:
CustomerRegistry.php:17
Magento\TestFramework\Helper\Bootstrap\getObjectManager
static getObjectManager()
Definition:
Bootstrap.php:125