You are here

public function UcAddressesAddress::setName in Ubercart Addresses 7

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

Sets the nickname of the address.

@access public

Parameters

string $name: The name to give to the address.

Return value

boolean TRUE if setting name was succesful. FALSE otherwise.

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

File

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

Class

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

Code

public function setName($name) {
  if ($this
    ->getName() === $name) {

    // Address already has this name, do nothing
    return TRUE;
  }
  if ($this->addressBook
    ->setAddressName($this, $name)) {
    $this
      ->setDirty();
    return TRUE;
  }
  return FALSE;
}