Website
\Components\Website\Designs \Components\Website\Pages \Components\Website\Pages\Forms \Components\Website\Posts \Components\Website\Posts\Categories
Customers
\Components\Customers\Contacts \Components\Customers\Contacts\Relationships \Components\Customers\Contacts\Relationships\Types \Components\Customers\Groups
Marketing
\Components\Marketing\EmailMarketing \Components\Marketing\Events \Components\Marketing\Events\Attendees \Components\Marketing\Events\Locations
Commerce
\Components\Commerce\Configuration\PaymentMethods \Components\Commerce\Configuration\ShippingMethods \Components\Commerce\Discounts \Components\Commerce\Products \Components\Commerce\Products\Brands \Components\Commerce\Products\Categories \Components\Commerce\Products\Inventory \Components\Commerce\Sales \Components\Commerce\Sales\Items \Components\Commerce\Sales\Receipts \Components\Commerce\Sales\Receipts\Allocations
Settings
\Components\Settings\Administrators \Components\Settings\Domains
Other Apps
\Components\Website\Comments \Components\Commerce\Affiliates \Components\Commerce\Affiliates\Administrators \Components\Commerce\Affiliates\Commissions \Components\Commerce\Affiliates\Payments \Components\Commerce\RecurringSales \Components\Commerce\RecurringSales\StoredCards
Framework
\Framework\Assets\CSS \Framework\Assets\JavaScript \Framework\Caching\FileBased \Framework\Data\Util \Framework\Date \Framework\HTML\Converters \Framework\HTTP\Cookies \Framework\HTTP\Redirection \Framework\HTTP\Request \Framework\HTTP\Session \Framework\HTTP\UserAgent \Framework\I18N\CompanyTypes \Framework\I18N\Countries \Framework\I18N\Languages \Framework\Network\GeoIP
.
.
.
Methods

\Components\Customers\Contacts::

Use this API to create, update and delete contacts.

Class Methods

The following methods are available on this class:
array current()
Returns the current contact logged in
Return
Contact
string currentAddress()
Returns a HTML formatted address for the contact
Return
Contact's full address
int currentContactId($bTrackingFallback)
Returns the id of the contact currently logged in
Parameters
$bTrackingFallback
mixed
Return
Id
string currentCountry()
Returns the country of the current contact
Return
string
string currentEmail()
Returns the email address of the contact currently logged in
Return
Email Address
string currentFullName()
Gets the user's full name
Return
Contact's first and last names as a concatenated string
string currentGetColumn($strColumn)
Retreives an attribute for the current user
Parameters
$strColumn
string
Return
Value of the attribute
bool currentHasPassword()
Returns whether the user is fully registered or not
Return
true if the user has a password, else false
bool currentIsLoggedIn($bTrackingFallback)
Returns whether or not the user is logged in.
Parameters
$bTrackingFallback
mixed
Return
true if logged in, else false
bool currentIsLoggedInThisSession()
Returns whether the user logged in this session or not
Return
true if logged in this session, else false
int currentLoginViaURL($iContactId, $strPasswordURL, $bFullLogIn)
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)
Logs out the current user
Parameters
$bDeleteTracking
bool
Delete tracking cookie as well?
void currentSaveColumn($strColumn, $strValue)
Sets an attribute for the current user
Parameters
$strColumn
string
$strValue
string
void currentSetCountry($strCountryId, $bSave)
Parameters
$strCountryId
mixed
$bSave
mixed
string currentSuggestUsername()
Suggests a unique username based on the users name
Return
Username
array get($iContactId, $bRemoteConnect)
Returns an entity
Parameters
$iContactId
int
A record's contact_id
$bRemoteConnect
bool
Return
array
array getAll($arrProperties)
Return a set of records from the database
Parameters
$arrProperties
array
Return
Array of Contacts
array getAllForEmail($strEmail, $arrProperties)
Returns all contact records for a given email address
Parameters
$strEmail
string
$arrProperties
array
Return
array
mixed getColumn($iContactId, $strColumn)
Gets a single field from a record
Parameters
$iContactId
int
A record's contact_id
$strColumn
string
Return
mixed
int getCount($arrFilter)
Returns a count of all rows in the component
Parameters
$arrFilter
array
Return
int
int getKeyFromEmail($strEmail)
Returns the contact id from an email address
Parameters
$strEmail
string
E-mail address
Return
Contact id
void getPublic($iContactId)
Parameters
$iContactId
int
A record's contact_id
void impersonateBegin($iContactId)
Assumes the role of a user for segment
Parameters
$iContactId
int
void impersonateEnd()
Resumes the role of the previous impersonation
int impersonateRealContactId($bTrackingFallback)
Returns the root user id
Parameters
$bTrackingFallback
bool
Return
$iContactId
void renderAddressForContact($arrContact)
Parameters
$arrContact
mixed
void renderAdmin($iContactId, $strLinkTarget, $bShowEmailMarketing, $bShowAdministrators, $strLink)
Parameters
$iContactId
mixed
$strLinkTarget
mixed
$bShowEmailMarketing
mixed
$bShowAdministrators
mixed
$strLink
mixed
void renderName($arrContact, $bLastNameFirst)
Parameters
$arrContact
mixed
$bLastNameFirst
mixed
void renderPhoneNumbersForContact($arrContact)
Parameters
$arrContact
mixed
void renderSaleBalance($arrContact, $bUseName)
Parameters
$arrContact
mixed
$bUseName
mixed
int save($arrEntity)
Saves a record into the database
Parameters
$arrEntity
array
Return
The record's contact_id
void saveColumn($iContactId, $strColumn, $strValue)
Saves a specific column of a row into a database
Parameters
$iContactId
int
A record's contact_id
$strColumn
string
$strValue
string
array search($strSearch, $arrProperties)
Performs a search
Parameters
$strSearch
string
Search query
$arrProperties
array
Return
Array of Contacts that match the search query.
bool delete($iContactId, $bDeleteMedia)
Deletes a record from the database
Parameters
$iContactId
int
A record's contact_id
$bDeleteMedia
bool
Return
Returns true if record existed and was deleted, otherwise false

Database Fields

The following fields are used when retrieving and saving entities.
contact_id
int (11)
contact_registered
datetime
Default value: 0000-00-00 00:00:00
contact_registered_via_import
0 or 1
contact_updated_datetime
datetime
contact_last_online
datetime
Default value: 0000-00-00 00:00:00
contact_username
string (63)
contact_email
string (127)
contact_email_secondary
string (127)
contact_email_secondary_cc
0 or 1
contact_email_marketing_status
Default value: subscribed
contact_email_bounce_count_soft
int unsigned
contact_email_bounce_count_hard
int unsigned
contact_general_communication_unsubscribe
datetime
contact_cookie_token
string (32)
contact_cookie_token_tracking
string (32)
contact_password_lost
string (32)
contact_password_url
string (32)
contact_password_requires_change
0 or 1
contact_type
Default value: Individual
contact_gender
contact_title
contact_first_name
string (63)
contact_last_name
string (63)
contact_spouse_name
string (63)
contact_address
string (127)
contact_suburb_city
string (127)
contact_postcode
string (8)
contact_state
string (127)
country_id
char (3)
contact_timezone
string (127)
contact_dob
date
contact_company
string (127)
contact_company_number_type
string (127)
contact_company_number
string (127)
contact_company_tax_registered
0 or 1
Default value: 1
contact_phone_home
string (31)
contact_phone_work
string (31)
contact_phone_mobile
string (31)
contact_phone_mobile_e164
string (31)
contact_phone_mobile_verification_code
string (6)
contact_phone_mobile_verification_code_datetime
datetime
contact_phone_mobile_sms_optout
int unsigned (1)
contact_phone_mobile_sms_bounce_count
int unsigned
contact_social_facebook_url
string (127)
contact_social_twitter_url
string (127)
contact_social_linkedin_url
string (127)
contact_social_google_url
string (127)
contact_social_youtube
string (127)
contact_social_instagram
string (127)
contact_website
string (255)
contact_picture
string (255)
contact_profile
0 or 1
contact_profile_about
string (65535)
contact_signature
string (255)
contact_page_registered
string (255)
contact_referrer_type_id
int (11)
contact_referrer_type_detail_id
int unsigned (10)
contact_referrer_url
string (255)
contact_referrer_text
string (255)
contact_screen_width
int
contact_screen_height
int
contact_privacy_email_unsubscribed
0 or 1
contact_privacy_no_online_status
0 or 1
contact_privacy_no_contact_messages
0 or 1
language_id
string (5)
affiliate_id
int unsigned (10)
affiliate_date
date