You are here

public function AddressBookController::addForm in Commerce Core 8.2

Builds the add form.

Parameters

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

\Drupal\profile\Entity\ProfileTypeInterface $profile_type: The profile type.

Return value

array The response.

1 string reference to 'AddressBookController::addForm'
commerce_order.routing.yml in modules/order/commerce_order.routing.yml
modules/order/commerce_order.routing.yml

File

modules/order/src/Controller/AddressBookController.php, line 237

Class

AddressBookController
Provides the address book UI.

Namespace

Drupal\commerce_order\Controller

Code

public function addForm(UserInterface $user, ProfileTypeInterface $profile_type) {
  $profile = $this->entityTypeManager
    ->getStorage('profile')
    ->create([
    'uid' => $user
      ->id(),
    'type' => $profile_type
      ->id(),
  ]);
  return $this->entityFormBuilder
    ->getForm($profile, 'address-book-add');
}