You are here

public function UcAddressesAddress::privChangeAddressBook in Ubercart Addresses 6.2

Same name and namespace in other branches
  1. 7 class/UcAddressesAddress.class.php \UcAddressesAddress::privChangeAddressBook()

Modify the address book of this address.

This can only be done if the address book already accepted the address as one of it's addresses.

@access public

Parameters

UcAddressesAddressBook $addressBook: The address book to move this address to.

Return value

boolean TRUE on success. FALSE otherwise.

File

class/UcAddressesAddress.class.php, line 610
Contains the UcAddressesAddress class.

Class

UcAddressesAddress
The main address class used by uc_addresses (and extension modules).

Code

public function privChangeAddressBook(UcAddressesAddressBook $addressBook) {
  foreach ($addressBook
    ->getAddresses() as $address) {
    if ($address === $this) {

      // Address appears in address book, changing address book approved.
      $this->addressBook = $addressBook;
      return TRUE;
    }
  }
  return FALSE;
}