Components \ commerce \ affiliates administrators commissions payments \ configuration paymentmethods \ shippingmethods \ methods delivery discounts \ products brands categories \ recurringsales storedcards \ sales items \ receipts allocations \ customers \ contacts passwords referrertypes \ relationships types \ groups contacts \ marketing \ emailmarketing \ sends contacts unsubscribers \ events attendees locations \ reminders \ automation eventremindertrigger \ settings administrators components configurationitems cpanel customfields \ developer scheduledtasks threads domains \ website \ analytics sessions comments \ designs generator media pages \ posts categories Framework \ architecture publicassets \ assets css javascript \ caching filebased \ components textualids \ data util \ database mainconnection date \ dom currentcontext renderer \ html converters highlighter javascript \ http redirection request session useragent \ i18n companytypes countries languages \ network cidr dns geoip random \ reflection api \ system filenames filesystem toasts
.
.
.
quick access
\ methods

\Components\Customers\Contacts::

Class Methods

The following static methods are available on this class:
bool autoMerge($arrEntity, $bAllowInsecureMerge)
Description
Tries to automatically merge a contact with an existing contact
Parameters
$arrEntity
array
$bAllowInsecureMerge
bool
Return
True on merge, false when not merging
string configGetValue($strConfigId)
Description
Retrieves the value of a config item for the current component
Parameters
$strConfigId
string
Return
Config item value
array current()
Description
Returns the current contact logged in
Parameters
none
Return
Contact
string currentAddress()
Description
Returns a HTML formatted address for the contact
Parameters
none
Return
Contact's full address
int currentContactId($bTrackingFallback)
Description
Returns the id of the contact currently logged in
Parameters
$bTrackingFallback
mixed
Return
Id
string currentCountry()
Description
Returns the country of the current contact
Parameters
none
Return
string
string currentEmail()
Description
Returns the email address of the contact currently logged in
Parameters
none
Return
Email Address
string currentFullName()
Description
Gets the user's full name
Parameters
none
Return
Contact's first and last names as a concatenated string
string currentGetColumn($strColumn)
Description
Retreives an attribute for the current user
Parameters
$strColumn
string
Return
Value of the attribute
bool currentHasPassword()
Description
Returns whether the user is fully registered or not
Parameters
none
Return
true if the user has a password, else false
bool currentIsLoggedIn($bTrackingFallback)
Description
Returns whether or not the user is logged in.
Parameters
$bTrackingFallback
mixed
Return
true if logged in, else false
bool currentIsLoggedInThisSession()
Description
Returns whether the user logged in this session or not
Parameters
none
Return
true if logged in this session, else false
int currentLoginViaURL($iContactId, $strPasswordURL, $bFullLogIn)
Description
Logs the contact in via a URL containing the contact id and a key

This is used when running email marketing campaigns etc, and the contact needs to be logged in.
Parameters
$iContactId
int
Contact id
$strPasswordURL
string
Password key
$bFullLogIn
bool
Do a full login or just track them silently in current sessions
Return
Contact id or null if log in failed
void currentLogout($bDeleteTracking)
Description
Logs out the current user
Parameters
$bDeleteTracking
bool
Delete tracking cookie as well?
Return
void
string currentSaveColumn($strColumn, $strValue)
Description
Sets an attribute for the current user
Parameters
$strColumn
string
$strValue
string
Return
Value of the attribute
void currentSetCountry($strCountryId, $bSave)
Description
Parameters
$strCountryId
mixed
$bSave
mixed
Return
void
string currentSuggestUsername()
Description
Suggests a unique username based on the users name
Parameters
none
Return
Username
bool delete($strKeyValue, $bDeleteMedia, $strReason)
Description
Deletes an entity and triggers the pre/post component events
Parameters
$strKeyValue
string
$bDeleteMedia
bool
$strReason
mixed
Return
bool
array get($strKey, $bRemoteConnect)
Description
Returns an entity
Parameters
$strKey
mixed
Value of the primary key
$bRemoteConnect
bool
Return
array
{Array} getAll($arrProperties)
Description
Return all entities in the database.
Parameters
$arrProperties
mixed
Return
Array of Contacts
array getAllForEmail($strEmail, $arrProperties)
Description
Returns all contact records for a given email address
Parameters
$strEmail
string
$arrProperties
array
Return
array
mixed getColumn($strKey, $strColumn)
Description
Returns a single column of an entity
Parameters
$strKey
string
$strColumn
string
Return
mixed
int getCount($arrFilter)
Description
Returns a count of all rows in the data adapter
Parameters
$arrFilter
array
Return
int
int getKeyFromEmail($strEmail)
Description
Returns the contact id from an email address
Parameters
$strEmail
string
E-mail address
Return
Contact id
void getPublic($strKey)
Description
Parameters
$strKey
mixed
Return
void
void impersonateBegin($iContactId)
Description
Assumes the role of a user for segment
Parameters
$iContactId
int
Return
void
void impersonateEnd()
Description
Resumes the role of the previous impersonation
Parameters
none
Return
void
int impersonateRealContactId($bTrackingFallback)
Description
Returns the root user id
Parameters
$bTrackingFallback
bool
Return
$iContactId
string mediaFolderGet($strKey)
Description
Returns the media folder for this data adapter
Parameters
$strKey
mixed
Return
Folder
void renderAddressForContact($arrContact)
Description
Parameters
$arrContact
mixed
Return
void
void renderAdmin($iContactId, $strLinkTarget, $bShowEmailMarketing, $bShowAdministrators, $strLink)
Description
Parameters
$iContactId
mixed
$strLinkTarget
mixed
$bShowEmailMarketing
mixed
$bShowAdministrators
mixed
$strLink
mixed
Return
void
void renderName($arrContact)
Description
Parameters
$arrContact
mixed
Return
void
void renderPhoneNumbersForContact($arrContact)
Description
Parameters
$arrContact
mixed
Return
void
mixed save($arrEntity, $strReason)
Description
Saves an entity and triggers the pre/post component events
Parameters
$arrEntity
array
$strReason
string
Return
mixed
mixed saveColumn($strKeyValue, $strColumn, $strValue, $strReason)
Description
Changes a column of an existing entity Supports primary keys spanning on several columns if passing $strKeyValue as an associative arry
Parameters
$strKeyValue
string
$strColumn
string
$strValue
string
$strReason
string
Return
Id
array search($strSearch, $arrProperties)
Description
Performs a search
Parameters
$strSearch
string
$arrProperties
mixed
Return
array

Database Fields

The following fields are used when retrieving and saving entities.
affiliate_date
date
affiliate_id
int unsigned (10)
contact_address
varchar (127)
contact_company
varchar (127)
contact_company_number
varchar (127)
contact_company_number_type
varchar (127)
contact_company_relationship_id
varchar (127)
contact_company_tax_registered
tinyint unsigned (1)
Default value: 1
contact_cookie_token
varchar (32)
contact_cookie_token_tracking
varchar (32)
contact_dob
date
contact_dob_d
int (11)
contact_dob_m
int (11)
contact_dob_y
int (11)
contact_domain
varchar (255)
contact_domain_username
varchar (255)
contact_email
varchar (127)
contact_email_bounce_count_hard
smallint unsigned (5)
contact_email_bounce_count_soft
smallint unsigned (5)
contact_email_marketing_status
enum ('pending','subscribed','unsubscribed')
Default value: subscribed
contact_email_secondary
varchar (127)
contact_email_secondary_cc
tinyint unsigned (1)
contact_fax
varchar (31)
contact_first_name
varchar (63)
contact_gender
enum ('m','f')
contact_general_communication_unsubscribe
datetime
contact_id
int (11)
contact_last_name
varchar (63)
contact_last_online
datetime
Default value: 0000-00-00 00:00:00
contact_page_registered
varchar (255)
contact_password_lost
varchar (10)
contact_password_requires_change
tinyint unsigned (1)
contact_password_url
varchar (8)
contact_phone
varchar (31)
contact_phone_home
varchar (31)
contact_phone_mobile
varchar (31)
contact_phone_mobile_e164
varchar (31)
contact_phone_mobile_sms_bounce_count
smallint unsigned (5)
contact_phone_mobile_sms_optout
int unsigned (1)
contact_phone_mobile_verification_code
varchar (6)
contact_phone_mobile_verification_code_datetime
datetime
contact_phone_work
varchar (31)
contact_picture
varchar (127)
contact_postcode
varchar (8)
contact_privacy_email_unsubscribed
tinyint (1)
contact_privacy_no_contact_messages
tinyint (1)
contact_privacy_no_online_status
tinyint (1)
contact_profile
tinyint (1)
contact_profile_about
text
contact_referrer_text
varchar (255)
contact_referrer_type_detail_id
int unsigned (10)
contact_referrer_type_id
int (11)
contact_referrer_url
varchar (255)
contact_registered
datetime
Default value: 0000-00-00 00:00:00
contact_registered_via_import
tinyint unsigned (1)
contact_sale_balance
int (11)
contact_screen_height
smallint (4)
contact_screen_width
smallint (4)
contact_signature
varchar (255)
contact_site_ssl
varchar (255)
contact_site_username
varchar (255)
contact_social_facebook_url
varchar (127)
contact_social_google_url
varchar (127)
contact_social_instagram
varchar (127)
contact_social_linkedin_url
varchar (127)
contact_social_twitter_url
varchar (127)
contact_social_youtube
varchar (127)
contact_spouse_name
varchar (63)
contact_state
varchar (127)
contact_suburb_city
varchar (127)
contact_timezone
varchar (127)
contact_title
enum ('Mr.','Mrs.','Miss','Ms.','Dr.')
contact_type
enum ('Individual','Company')
Default value: Individual
contact_updated_datetime
datetime
contact_username
varchar (63)
contact_website
varchar (255)
contact_xero_id
varchar (255)
country_id
char (3)
language_id
varchar (5)