ContactsUtil Class Reference

Static Public Member Functions

static getStartingStateOrder (array $states)
static getStartingState ()
static getStartingStateId ()
static getContactStateDataKeyedByOrder ()
static getContactStateLabelsKeyedByLanguageAndOrder ()
static getContactStateDataKeyedById ()
static getContactStateDataFromStartingStateOnAndKeyedById ()
static getContactStateDataFromStartingStateKeyedByIdAndLabelByLanguage ($language)
static getAllContactStatesDataFromStartingStateKeyedByIdAndLabelByLanguage ($language)
static getContactStateDataFromStartingStateLabelByLanguage ($language)
static setStartingStateById ($startingStateId)
static setStartingStateByOrder ($startingStateOrder)
static resolveContactStateAdapterByModulesUserHasAccessTo ($moduleClassNameFirstStates, $moduleClassNameLaterStates, $user)
static resolveStateLabelByLanguage (ContactState $state, $language)
static resolveAddressesFromRelatedAccount (Contact &$contact)
static renderHtmlContentLabelFromContactAndKeyword ($contact, $keyword)
static resolveMarketingListMembersByContact ($contact)

Detailed Description

Helper class with functions to assist in working with Contacts module information

Definition at line 42 of file ContactsUtil.php.


Member Function Documentation

static getStartingStateOrder ( array $  states  )  [static]

Given an array of states, determine what the startingState order number is.

Returns:
int order

Definition at line 49 of file ContactsUtil.php.

static getStartingState (  )  [static]
Returns:
ContactState object

Definition at line 68 of file ContactsUtil.php.

static getStartingStateId (  )  [static]
Returns:
integer Id

Definition at line 77 of file ContactsUtil.php.

static getContactStateDataKeyedByOrder (  )  [static]

Get an array of order/name pairings of the existing contact states ordered by order.

Returns:
array

Definition at line 87 of file ContactsUtil.php.

static getContactStateLabelsKeyedByLanguageAndOrder (  )  [static]

Get an array of order/ label translation array pairings of the existing contact states ordered by order.

Returns:
array

Definition at line 102 of file ContactsUtil.php.

static getContactStateDataKeyedById (  )  [static]

Get an array of order/name pairings of the existing contact states ordered by order.

Returns:
array

Definition at line 124 of file ContactsUtil.php.

static getContactStateDataFromStartingStateOnAndKeyedById (  )  [static]

Get an array of only the states from the starting state onwards, id/name pairings of the existing contact states ordered by order.

Returns:
array

Definition at line 140 of file ContactsUtil.php.

static getContactStateDataFromStartingStateKeyedByIdAndLabelByLanguage ( language  )  [static]

Get an array of only the states from the starting state onwards, id/translated label pairings of the existing contact states ordered by order.

Parameters:
string language
Returns:
array

Definition at line 166 of file ContactsUtil.php.

static getAllContactStatesDataFromStartingStateKeyedByIdAndLabelByLanguage ( language  )  [static]

Get an array of only the states from the starting state onwards, id/translated label pairings of the existing contact states ordered by order.

Parameters:
string language
Returns:
array

Definition at line 193 of file ContactsUtil.php.

static getContactStateDataFromStartingStateLabelByLanguage ( language  )  [static]

Get an array of states from the starting state onwards, id/translated label pairings of the existing contact states ordered by order.

Returns:
array

Definition at line 210 of file ContactsUtil.php.

static setStartingStateById ( startingStateId  )  [static]
Parameters:
int $startingStateId

Definition at line 236 of file ContactsUtil.php.

static setStartingStateByOrder ( startingStateOrder  )  [static]
Parameters:
$startingStateOrder 
Exceptions:
NotSupportedException 

Definition at line 248 of file ContactsUtil.php.

static resolveContactStateAdapterByModulesUserHasAccessTo ( moduleClassNameFirstStates,
moduleClassNameLaterStates,
user 
) [static]

Given two module class names and a user, resolve based on the user's access what if any adapter should be utilized. If the user has access to both modules, then return null. If the user has access to none of the modules, then return false. Otherwise return a string with the name of the appropriate adapter to use.

Parameters:
string $moduleClassNameFirstStates
string $moduleClassNameLaterStates
object $user User model

Definition at line 271 of file ContactsUtil.php.

static resolveStateLabelByLanguage ( ContactState state,
language 
) [static]

Given a CustomFieldData object, return an array of data and translated labels indexed by the data name.

Parameters:
CustomFieldData $customFieldData $param string $language

Definition at line 305 of file ContactsUtil.php.

static resolveAddressesFromRelatedAccount ( Contact &$  contact  )  [static]

Given a contact with a related account, set the contact address information from the account address information

Parameters:
Contact $contact

Definition at line 316 of file ContactsUtil.php.

static renderHtmlContentLabelFromContactAndKeyword ( contact,
keyword 
) [static]

Given a contact model and a keyword, render the strval of the contact and the matched email address that the keyword matches. If the keyword does not match any email addresses on the contact, render the primary email if it exists. Otherwise just render the strval contact.

Parameters:
object $contact - model
string $keyword

Definition at line 344 of file ContactsUtil.php.

static resolveMarketingListMembersByContact ( contact  )  [static]
Parameters:
$contact Contact::beforeDelete() resolves associated marketingListMembers, cascades deletion

Definition at line 371 of file ContactsUtil.php.


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables
Generated on Fri May 26 07:10:24 2017