Use this API to create, update and delete contacts.
If you are just looking to create forms that collect contacts in a secure manner, it is recommended that you use the forms:form control with the contactmode attribute.
Security Warning: With great power comes great responsibility. This API is for experienced developers to query data from the contacts component. Customer data is sensitive, so you must take great care not to introduce a data leak or vulnerability.
Security Warning: You can retreive contact data via functions such as get() and getAll(). This can be displayed on a public website through the use of a repeater or varDump().
Security Warning: This API also allows you to save customer data. Ensure that if updating existing records, any supplied contact_id is validated so only the intended contacts can be overwritten.
Methods
Invoke via \Components\Customers\Contacts::method() Click a method name to copy it.
Determines whether a company name is really just the contact's own name.
Accounting and CRM systems routinely mirror a person's display name into their company field (QuickBooks Online, Xero, MYOB, PracticeManager and Mindbody all do this), so a company name equal to the person's name identifies no employer. Treating it as one produces a second contact indistinguishable from the first.
Compares case-insensitively and ignores comma and whitespace differences, so "Zamora, Andrew" matches "Andrew Zamora". Matching is exact, never substring, so a genuine trading name such as "Andrew Zamora Consulting" is still a real company.
Parameters:
- $strCompanyName
mixed
- $strFirstName
mixed
- $strLastName
mixed
Return
True when the company name is just the person's own name
Suggests a unique username based on the users name
Return
Username
- `
\Iterator
dbGetAllIterable($arrQuery)`
Returns the raw rows dbGetAll() would return as an iterator, without building them all into an array
The dbGetAll() counterpart of getAllIterable(), for scans over every stored row of a large table (eg: the site-wide content scans in \Framework\Developer\Refactoring). Rows are as stored - JSON fields are not decoded - and are not entity-cached. Because it bypasses getAll(), components that override getAll() are iterated; search queries and components overriding dbGetAll() are refused.
Returns the entities getAll() would return as an iterator, without building them all into an array
For result sets too large to hold as arrays (eg: every recipient of a marketing send) - only the database driver's compact buffer of the result is held, a fraction of getAll()'s memory. Runs the same SQL as getAll(), and runs it now, as getAll() would; rows are decoded as you iterate.
Search queries are not supported, rows are not entity-cached, and components that override getAll() or dbGetAll() (eg: merging in defaults) are refused rather than iterated without their extra rows.