You are here

protected function StoreTax::buildStoreProfile in Commerce Core 8.2

Builds a customer profile for the given store.

Parameters

\Drupal\commerce_store\Entity\StoreInterface $store: The store.

Return value

\Drupal\profile\Entity\ProfileInterface The customer profile.

1 call to StoreTax::buildStoreProfile()
StoreTax::getDefaultRates in modules/tax/src/StoreTax.php
Gets the default tax rates for the given store and order item.

File

modules/tax/src/StoreTax.php, line 164

Class

StoreTax

Namespace

Drupal\commerce_tax

Code

protected function buildStoreProfile(StoreInterface $store) {
  $store_id = $store
    ->id();
  if (!isset($this->storeProfiles[$store_id])) {
    $profile_storage = $this->entityTypeManager
      ->getStorage('profile');
    $this->storeProfiles[$store_id] = $profile_storage
      ->create([
      'type' => 'customer',
      'uid' => 0,
      'address' => $store
        ->getAddress(),
    ]);
  }
  return $this->storeProfiles[$store_id];
}