You are here

public static function UcAddressesAddressBook::newAddress in Ubercart Addresses 7

Same name and namespace in other branches
  1. 6.2 class/UcAddressesAddressBook.class.php \UcAddressesAddressBook::newAddress()

Create a new unowned address.

This method will create an empty address without an owner. This is useful when you want to ask an anonymous user for an address (e.g., when registering). However, unonwed addresses can not be saved. In order to save this address, the UcAddressesAddress method setOwner() should be called.

@access public @static

Return value

UcAddressesAddress A new instance of UcAddressesAddress.

12 calls to UcAddressesAddressBook::newAddress()
FeedsUcAddressesProcessor::newEntity in feeds/FeedsUcAddressesProcessor.inc
Creates a new address in memory and returns it.
hook_uc_addresses_select_addresses in ./uc_addresses.api.php
With this hook you can deliver an array of addresses on which the user can select one at checkout or when editing the order, depending on the context $context.
UcAddressesAddress::newAddress in class/UcAddressesAddress.class.php
Create a new unowned address.
UcAddressesApiTestCase::testFieldHandlerApi in tests/uc_addresses.api.test
Tests field handler with an UcAddressesSchemaAddress.
UcAddressesCartCheckoutTestCase::doDefaultAddressesTests in tests/uc_addresses.checkout.test
Checkout with the default addresses.

... See full list

File

class/UcAddressesAddressBook.class.php, line 211
Contains the UcAddressesAddressBook class.

Class

UcAddressesAddressBook
The address book class

Code

public static function newAddress() {
  return self::get(0)
    ->addAddress();
}