You are here

public function UcAddressesAddress::label in Ubercart Addresses 6.2

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

Returns address name if given.

If the address has no name, it will use the address format as label instead.

@todo better alternative for address name?

Return value

string The address name.

File

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

Class

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

Code

public function label() {
  $name = $this
    ->getName();
  if ($name) {
    return $name;
  }
  return preg_replace('/<.*?>/', ', ', trim(uc_addresses_format_address($this)));
}