You are here

public function AddressBookInterface::copy in Commerce Core 8.2

Copies the profile to the customer's address book.

If the customer is allowed to have multiple profiles of this type, the given profile will be duplicated and assigned to them. If the given profile was already copied to the customer's address book once, the matching address book profile will be updated instead.

If the customer is only allowed to have a single profile of this type, the default profile will be loaded (created if missing) and updated.

Parameters

\Drupal\profile\Entity\ProfileInterface $profile: The profile.

\Drupal\user\UserInterface $customer: The customer.

1 method overrides AddressBookInterface::copy()
AddressBook::copy in modules/order/src/AddressBook.php
Copies the profile to the customer's address book.

File

modules/order/src/AddressBookInterface.php, line 130

Class

AddressBookInterface
Represents a customer's address book.

Namespace

Drupal\commerce_order

Code

public function copy(ProfileInterface $profile, UserInterface $customer);