You are here

public static function Address::create in Ubercart 8.4

Creates an Address.

Parameters

array $values: (optional) Array of initialization values.

Return value

\Drupal\uc_store\AddressInterface An Address object.

15 calls to Address::create()
AddressForm::selectAddress in shipping/uc_fulfillment/src/Form/AddressForm.php
Chooses an address to fill out a form.
AddressPaneBase::process in uc_cart/src/Plugin/Ubercart/CheckoutPane/AddressPaneBase.php
Processes a checkout pane.
AddressTest::testAddressFormat in uc_store/tests/src/Functional/AddressTest.php
Tests formatting of addresses.
AddressTestTrait::createAddress in uc_store/tests/src/Traits/AddressTestTrait.php
Creates an address object based on default settings.
Check::cartDetails in payment/uc_payment_pack/src/Plugin/Ubercart/PaymentMethod/Check.php
Returns the form or render array to be displayed at checkout.

... See full list

File

uc_store/src/Address.php, line 41

Class

Address
Defines an object to hold Ubercart mailing address information.

Namespace

Drupal\uc_store

Code

public static function create(array $values = NULL) {
  $address = new Address();
  if (isset($values)) {
    foreach ($values as $key => $value) {
      if (property_exists($address, $key)) {
        $address->{$key} = $value;
      }
    }
  }
  return $address;
}