You are here

public function UcAddressesAddressBook::getDefaultAddress in Ubercart Addresses 7

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

Returns a default address.

@access public

Parameters

string $type: The address type to get (shipping, billing).

Return value

UcAddressesAddress if the address is found. NULL otherwise.

1 call to UcAddressesAddressBook::getDefaultAddress()
UcAddressesAddressBook::setAddressAsDefault in class/UcAddressesAddressBook.class.php
Set an address as a default address.

File

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

Class

UcAddressesAddressBook
The address book class

Code

public function getDefaultAddress($type = 'billing') {
  if (isset($this->defaultAddresses[$type])) {
    return $this->defaultAddresses[$type];
  }
  if (!$this->defaultsLoaded) {
    $this
      ->loadDefaults();
  }
  if (isset($this->defaultAddresses[$type])) {
    return $this->defaultAddresses[$type];
  }
  return NULL;
}