CRM_Contact_BAO_Contact_Utils
class CRM_Contact_BAO_Contact_Utils
Methods
Given a contact type, get the contact image.
Function check for mix contact ids(individual+household etc.
Generate a checksum for a $entityId of type $entityType
Make sure the checksum is valid for the passed in contactID.
Create Current employer relationship for a individual.
Create related memberships for current employer.
Set current employer id and organization name.
Update cached current employer name.
Clear cached current employer name.
Build form for related contacts / on behalf of organization.
Clear cache employer name and employer id of all employee when employer get deleted.
Given an array of contact ids this function will return array with links to view contact page.
This function retrieve component related contact information.
Function handles shared contact address processing.
Get the list of contact name give address associated array.
Clear the contact cache so things are kosher. We started off being super aggressive with clearing caches, but are backing off from this with every release. Compromise between ease of coding versus performance versus being accurate at that very instant
No description
Fetch the default greeting for a given contact type.
Get the tokens that will need to be resolved to populate the contact's greetings.
Process a greeting template string to produce the individualised greeting text.
Determine if a contact ID is real/valid.
Details
at line 49
static string
getImage(string $contactType, bool $urlOnly = FALSE, int $contactId = NULL, bool $addProfileOverlay = TRUE)
Given a contact type, get the contact image.
at line 124
static bool
checkContactType(array $contactIds)
Function check for mix contact ids(individual+household etc.
..)
at line 156
static array
generateChecksum(int $entityId, int $ts = NULL, int $live = NULL, string $hash = NULL, string $entityType = 'contact', null $hashSize = NULL)
Generate a checksum for a $entityId of type $entityType
at line 220
static bool
validChecksum(int $contactID, string $inputCheck)
Make sure the checksum is valid for the passed in contactID.
at line 256
static
createCurrentEmployerRelationship(int $contactID, $organization, int $previousEmployerID = NULL, bool $newContact = FALSE)
Create Current employer relationship for a individual.
at line 332
static
currentEmployerRelatedMembership(int $contactID, int $employerID, array $relationshipParams, bool $duplicate = FALSE, int $previousEmpID = NULL)
Create related memberships for current employer.
at line 363
static
setCurrentEmployer(array $currentEmployerParams)
Set current employer id and organization name.
at line 378
static
updateCurrentEmployer(int $organizationId)
Update cached current employer name.
at line 394
static
clearCurrentEmployer(int $contactId, int $employerId = NULL)
Clear cached current employer name.
at line 444
static
buildOnBehalfForm(CRM_Core_Form $form, string $contactType, int $countryID, int $stateID, string $title)
Build form for related contacts / on behalf of organization.
at line 512
static
clearAllEmployee(int $employerId)
Clear cache employer name and employer id of all employee when employer get deleted.
at line 535
static array
formatContactIDSToLinks(array $contactIDs, bool $addViewLink = TRUE, bool $addEditLink = TRUE, int $originalId = NULL)
Given an array of contact ids this function will return array with links to view contact page.
at line 643
static array
contactDetails(array $componentIds, string $componentName, array $returnProperties = [])
This function retrieve component related contact information.
at line 780
static
processSharedAddress(array $address)
Function handles shared contact address processing.
In this function we just modify submitted values so that new address created for the user has same address as shared contact address. We copy the address so that search etc will be much more efficient.
at line 841
static array
getAddressShareContactNames(array $addresses)
Get the list of contact name give address associated array.
at line 881
static
clearContactCaches(bool $isEmptyPrevNextTable = FALSE)
Clear the contact cache so things are kosher. We started off being super aggressive with clearing caches, but are backing off from this with every release. Compromise between ease of coding versus performance versus being accurate at that very instant
at line 901
static
updateGreeting(array $params)
at line 1057
static int|null
defaultGreeting(string $contactType, string $greetingType)
Fetch the default greeting for a given contact type.
at line 1085
static array
getTokensRequiredForContactGreetings(array $contactParams)
Get the tokens that will need to be resolved to populate the contact's greetings.
at line 1126
static
processGreetingTemplate(string $templateString, array $contactDetails, int $contactID, string $className)
Process a greeting template string to produce the individualised greeting text.
This works just like message templates for mailings: the template is processed with the token substitution mechanism, to supply the individual contact data; and it is also processed with Smarty, to allow for conditionals etc. based on the contact data.
Note: We don't pass any variables to Smarty -- all variable data is inserted into the input string by the token substitution mechanism, before Smarty is invoked.
at line 1140
static bool
isContactId(int $contactId)
Determine if a contact ID is real/valid.