You are here

public function UcAddressesAddress::setOwner in Ubercart Addresses 7

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

Changes the owner of this address.

@access public

Parameters

int $uid: The new owner of the address.

Return value

UcAddressesAddressBook The address book the address will belong to; or NULL if the address was already owned.

1 call to UcAddressesAddress::setOwner()
UcAddressesAddress::setField in class/UcAddressesAddress.class.php
Override of UcAddressesSchemaAddress::setField().

File

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

Class

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

Code

public function setOwner($uid) {

  // The owner of this address may only be changed if it doesn't belong to
  // anyone yet.
  if ($this
    ->isOwned()) {

    // Changing the owner not allowed.
    return;
  }

  // Setting the owner goes via the address book.
  return $this->addressBook
    ->setAddressOwner($this, $uid);
}