All Data Structures Functions Variables Pages
Static Public Member Functions | Data Fields
LeadsUtil Class Reference

Static Public Member Functions

static attributesToAccount (Contact $contact, Account $account)
 
static attributesToAccountWithNoPostData (Contact $contact, Account $account, array $postData)
 
static storeIntoSession ($key, $value)
 
static getFromSession ($key)
 
static removeFromSession ($key)
 
static createAccountForLeadConversionFromAccountPostData ($accountPostData, $contact, $controllerUtil)
 
static getStartingState ()
 
static getLeadStateDataFromStartingStateOnAndKeyedById ()
 
static getLeadStateDataFromStartingStateKeyedByIdAndLabelByLanguage ($language)
 
static getLeadStateDataFromStartingStateLabelByLanguage ($language)
 
static isStateALead (ContactState $state)
 
static isStateALeadByStateName ($stateName)
 

Data Fields

const LEAD_CONVERSION_ACCOUNT_DATA_SESSION_KEY = 'leadConversionAccountPostData'
 

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
$contactContact model
$accountAccount model
Returns
Account, with mapped attributes from Contact

Definition at line 54 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
$contactContact model
$accountAccount model
$postDataarray of posted form data
Returns
Account, with mapped attributes from Contact

Definition at line 82 of file LeadsUtil.php.

static getStartingState ( )
static

If no states exist, throws MissingContactsStartingStateException

Returns
ContactState object

Definition at line 152 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 167 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 189 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 212 of file LeadsUtil.php.

static isStateALead ( ContactState  $state)
static
Parameters
ContactState$state
Returns
bool

Definition at line 234 of file LeadsUtil.php.

static isStateALeadByStateName (   $stateName)
static
Parameters
string$stateName
Returns
bool

Definition at line 251 of file LeadsUtil.php.


The documentation for this class was generated from the following file:
Generated on Thu Jun 4 2020 07:10:50