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.
Get the count of contact loctions.
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.
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 158
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 222
static bool
validChecksum(int $contactID, string $inputCheck)
Make sure the checksum is valid for the passed in contactID.
at line 255
static int
maxLocations(int $contactId)
Get the count of contact loctions.
at line 284
static
createCurrentEmployerRelationship(int $contactID, $organization, int $previousEmployerID = NULL, bool $newContact = FALSE)
Create Current employer relationship for a individual.
at line 360
static
currentEmployerRelatedMembership(int $contactID, int $employerID, array $relationshipParams, bool $duplicate = FALSE, int $previousEmpID = NULL)
Create related memberships for current employer.
at line 392
static
setCurrentEmployer(array $currentEmployerParams)
Set current employer id and organization name.
at line 410
static
updateCurrentEmployer(int $organizationId)
Update cached current employer name.
at line 426
static
clearCurrentEmployer(int $contactId, int $employerId = NULL)
Clear cached current employer name.
at line 477
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 548
static
clearAllEmployee(int $employerId)
Clear cache employer name and employer id of all employee when employer get deleted.
at line 571
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 679
static array
contactDetails(array $componentIds, string $componentName, array $returnProperties = array())
This function retrieve component related contact information.
at line 808
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 efficient.
at line 866
static array
getAddressShareContactNames(array $addresses)
Get the list of contact name give address associated array.
at line 903
static
clearContactCaches($contactID = NULL)
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 920
static
updateGreeting(array $params)
at line 1076
static int|NULL
defaultGreeting(string $contactType, string $greetingType)
Fetch the default greeting for a given contact type.
at line 1117
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 1131
static bool
isContactId(int $contactId)
Determine if a contact ID is real/valid.