ContactSearch
Extends Search. ContactSearch allows theme developers to find and present searchable Contacts within Evance's Contact Manager. This may be useful for building team profiles, user directories or business listings.
Getting started
Start by instantiating a new ContactSearch
object. Let's say you wish to list Trade Partners
on your website using information pulled directly from Contact profiles. We'll assume Access Roles are used in this example,
and that we only wish to display 10 profiles at a time per page.
<?ev
var search = new ContactSearch();
search.withAccessRoles('Trade Partner');
search.limit(10).requestPagination();
for (var contact of search) {
// do something
}
?>
Methods |
---|
inBranches(Array:branches)
ContactSearch
Search for Contact details that have been assigned to one or more Branch, which may be supplied as an array of Branch objects, or any array of Branch IDs. |
orderBy(String:sort)
ContactSearch
Sets the order and direction of the search. Available sort strings:
|
withAccessRoles(Array:names)
ContactSearch
Search for Contacts assigned at least one of the Access Roles supplied by name. |
withAccessRoleReferences(Array:refs)
ContactSearch
Search for Contacts assigned at least one of the Access Roles supplied by unique references. |
withDepartments(Array:names)
ContactSearch
Filter Contacts by their department. You may supply one or more department names, which does a case-insensitve match. |
withIds(Array:ids)
ContactSearch
Search for Contact details where the IDs of each profile are known. |
withMeta(String:selector, Mixed:value)
ContactSearch
Search for Contact details matching metafield selector values. Values may be supplied as either a String, Number or an Array containing String or Number values. When an array is encountered, the Contact may have any of the values for the selector. |
withReferences(Array:refs)
ContactSearch
Search for Contact details based on their unique reference. |
withTags(Array:tags)
ContactSearch
Find Contacts by one or more tags. If you supply multiple tags, the Contact may match at least one - they do not have to match all. |
withTerritories(Array:countryCodes, Boolean:strict = true)
ContactSearch
Contacts may be assigned zero or more territories within their profiles. When in |
withWorkAnniversary(Date:date, Number:fuzziness = 0)
ContactSearch
Search for Contacts with a work anniversary on the |