LeadsUtil Class Reference

Static Public Member Functions

static attributesToAccount (Contact $contact, Account $account)
static attributesToAccountWithNoPostData (Contact $contact, Account $account, array $postData)
static getStartingState ()
static getLeadStateDataFromStartingStateOnAndKeyedById ()
static getLeadStateDataFromStartingStateKeyedByIdAndLabelByLanguage ($language)
static getLeadStateDataFromStartingStateLabelByLanguage ($language)
static isStateALead (ContactState $state)
static isStateALeadByStateName ($stateName)

Detailed Description

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

Definition at line 42 of file LeadsUtil.php.


Member Function Documentation

static attributesToAccount ( Contact contact,
Account account 
) [static]

Given a contact and an account, use the mapping in the Leads Module to copy attributes from contact to Account order number is.

Parameters:
$contact Contact model
$account Account model
Returns:
Account, with mapped attributes from Contact

Definition at line 52 of file LeadsUtil.php.

static attributesToAccountWithNoPostData ( Contact contact,
Account account,
array $  postData 
) [static]

Given a post data array, map the lead to account attributes but only if the post data does not contain a set attribute. This method is used when a posted form has an empty value on an input field. We do not want to set the mapped field since the use of setAttributes will pick up the correct information from the posted data. This will allow form validation to work properly in the case where a mapped field is cleared to blank in the input field and submitted. Such an event should trigger a form validation error.

See also:
LeadsUtil::attributesToAccount
Parameters:
$contact Contact model
$account Account model
$postData array of posted form data
Returns:
Account, with mapped attributes from Contact

Definition at line 80 of file LeadsUtil.php.

static getStartingState (  )  [static]

If no states exist, throws MissingContactsStartingStateException

Returns:
ContactState object

Definition at line 100 of file LeadsUtil.php.

static getLeadStateDataFromStartingStateOnAndKeyedById (  )  [static]

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

Returns:
array

Definition at line 115 of file LeadsUtil.php.

static getLeadStateDataFromStartingStateKeyedByIdAndLabelByLanguage ( language  )  [static]

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

Parameters:
string $language
Returns:
array

Definition at line 137 of file LeadsUtil.php.

static getLeadStateDataFromStartingStateLabelByLanguage ( language  )  [static]

Get an array of 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 160 of file LeadsUtil.php.

static isStateALead ( ContactState state  )  [static]
Parameters:
ContactState $state
Returns:
bool

Definition at line 182 of file LeadsUtil.php.

static isStateALeadByStateName ( stateName  )  [static]
Parameters:
string $stateName
Returns:
bool

Definition at line 199 of file LeadsUtil.php.


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables
Generated on Sat Apr 29 07:10:25 2017