CRM_Utils_Address
in package
Address Utilities
Tags
Table of Contents
Methods
- format() : string
- Format an address string from address fields and a format string.
- formatVCard() : string
- Format an address in the vcard format.
- getDefaultDistanceUnit() : string
- getFormattedBillingAddressFieldsFromParameters() : string
- Extract the billing fields from the form submission and format them for display.
- sequence() : array<string|int, mixed>
Methods
format()
Format an address string from address fields and a format string.
public
static format(array<string|int, mixed> $fields[, string $format = NULL ][, bool $microformat = FALSE ][, bool $unused = FALSE ][, array<string|int, string> $tokenFields = NULL ]) : string
Format an address basing on the address fields provided. Use Setting's address_format if there's no format specified.
This function is also used to generate a contact's display_name and sort_name.
Parameters
- $fields : array<string|int, mixed>
-
The address fields.
- $format : string = NULL
-
The desired address format.
- $microformat : bool = FALSE
-
If true indicates, the address to be built in hcard-microformat standard.
- $unused : bool = FALSE
-
Should ALWAYS be false.
- $tokenFields : array<string|int, string> = NULL
Return values
string —formatted address string
formatVCard()
Format an address in the vcard format.
public
static formatVCard(array<string|int, mixed> $fields) : string
Parameters
- $fields : array<string|int, mixed>
-
The address fields.
Return values
string —formatted address string
getDefaultDistanceUnit()
public
static getDefaultDistanceUnit() : string
Return values
stringgetFormattedBillingAddressFieldsFromParameters()
Extract the billing fields from the form submission and format them for display.
public
static getFormattedBillingAddressFieldsFromParameters(array<string|int, mixed> $params) : string
Parameters
- $params : array<string|int, mixed>
Return values
stringsequence()
public
static sequence(string $format) : array<string|int, mixed>
Parameters
- $format : string