$_links
$_links : array
Links.
Turba external API interface.
This file defines Turba's external API interface. Other applications can interact with Turba through this API.
Copyright 2009-2017 Horde LLC (http://www.horde.org/)
See the enclosed file LICENSE for license information (ASL). If you did did not receive this file, see http://www.horde.org/licenses/apache.
sources(boolean $writeable = false, boolean $sync_only = false) : array
Returns a list of available sources.
boolean | $writeable | If true, limits to writeable sources. |
boolean | $sync_only | Only include synchable address books. |
An array of the available sources. Keys are source IDs, values are source titles.
fields(string $source = null) : array
Returns a list of fields avaiable in a source.
string | $source | The source name. |
An array describing the fields. Keys are the field name, values are arrays with these keys:
browse(string $path = '', array $properties = array('name', 'icon', 'browseable')) : array
Browses through Turba's object tree.
string | $path | The path of the tree to browse. |
array | $properties | The item properties to return. Defaults to 'name', 'icon', and 'browseable'. |
Content of the specified path.
listUids(string|array $sources = null) : array
Returns an array of UIDs for all contacts that the current user is authorized to see.
string|array | $sources | The name(s) of the source(s) to return contacts of. If empty, the current user's sync sources or default source are used. |
An array of UIDs for all contacts the user can access.
listBy(string $action, integer $timestamp, string|array $sources = null, integer $end = null, boolean $isModSeq = false) : array
Returns an array of UIDs for contacts that have had a given action since a certain time.
string | $action | The action to check for - add, modify, or delete. |
integer | $timestamp | The time to start the search. |
string|array | $sources | The source(s) for which to retrieve the history. |
integer | $end | The optional ending timestamp. |
boolean | $isModSeq | If true, $timestamp and $end are modification sequences and not timestamps. @since 4.1.1 |
An array of UIDs matching the action and time criteria.
getChanges(integer $start, integer $end, boolean $isModSeq = false, string|array $sources = null) : array
Method for obtaining all server changes between two timestamps.
Essentially a wrapper around listBy(), but returns an array containing all adds, edits, and deletions.
integer | $start | The starting timestamp |
integer | $end | The ending timestamp. |
boolean | $isModSeq | If true, $start and $end are modification sequences and not timestamps. @since 4.1.1 |
string|array | $sources | The sources to check. @since 4.2.0 |
A hash with 'add', 'modify' and 'delete' arrays.
getChangesByModSeq(integer $start, integer $end, string|array $sources = null) : array
Return all changes occuring between the specified modification sequences.
integer | $start | The starting modseq. |
integer | $end | The ending modseq. |
string|array | $sources | The sources to check. @since 4.2.0 |
The changes @see getChanges()
getActionTimestamp(string $uid, string $action, string|array $sources = null, boolean $modSeq = false) : integer
Returns the timestamp of an operation for a given UID and action.
string | $uid | The UID to look for. |
string | $action | The action to check for - add, modify, or delete. |
string|array | $sources | The source(s) for which to retrieve the history. |
boolean | $modSeq | Request a modification sequence instead of timestamp. @since 4.1.1 |
The timestamp for this action.
getHighestModSeq(string $id = null) : integer
Return the largest modification sequence from the history backend.
string | $id | Addressbook id to return highest MODSEQ for. If null, the highest MODSEQ across all addressbooks is returned. @since 4.2.0 |
The modseq.
import(string $content, string $contentType = 'array', string $source = null, array $options = array()) : string
Import a contact represented in the specified contentType.
string | $content | The content of the contact. |
string | $contentType | What format is the data in? Currently supports array, text/directory, text/vcard, text/x-vcard, and activesync. |
string | $source | The source into which the contact will be imported. |
array | $options | Additional options:
|
The new UID.
addGroup(string $name, array $members, array $opts = array()) : array
Adds a group (and its members) to the source provided.
string | $name | Group name. |
array | $members | An array of members to add to the group. Format is the same as the 'array' argument to the import() API function. |
array | $opts | Additional options: - attr: (array) Additional attributes to add to group. - source: (string) Source to import contacts to. |
An array with the following keys:
- added: (integer) The number of addresses added to the group. - uid: (string) The uid of the group object.
export(string $uid, mixed $contentType, string|array $sources = null, array $fields = null, array $options = array()) : mixed
Export a contact, identified by UID, in the requested contentType.
string | $uid | Identify the contact to export. |
mixed | $contentType | What format should the data be in?
|
string|array | $sources | The source(s) from which the contact will be exported. |
array | $fields | Hash of field names and Horde_SyncMl_Property properties with the requested fields. |
array | $options | Any additional options to be passed to the exporter. Currently supported:
|
The requested data.
getOwnContactObject() : array
Helper function to return the user's own contact object
An array containing the following keys:
delete(string|array $uid, string|array $sources = null) : boolean
Deletes a contact identified by UID.
string|array | $uid | Identify the contact to delete, either a single UID or an array. |
string|array | $sources | The source(s) from which the contact will be deleted. |
Success or failure.
replace(string $uid, mixed $content, string $contentType, string|array $sources = null) : boolean
Replaces the contact identified by UID with the content represented in the specified contentType.
string | $uid | Idenfity the contact to replace. |
mixed | $content | The content of the contact. |
string | $contentType | What format is the data in? Currently supports array, text/directory, text/vcard, text/x-vcard and activesync. |
string|array | $sources | The source(s) where the contact will be replaced. |
Success or failure.
search(mixed $names = null, array $opts = array()) : mixed
Returns a contact search result.
mixed | $names | The search filter values. |
array | $opts | Optional parameters:
|
Either a hash containing the search results or a Rfc822 List object (if 'rfc822Return' is true).
getContact(string $source = null, string $objectId = '') : array
Retrieves a contact.
string | $source | The source name where the contact is stored |
string | $objectId | The unique id of the contact to retrieve |
The retrieved contact.
getContacts(string $source = '', array $objectIds = array()) : array
Retrieves a set of contacts from a single source.
string | $source | The source name where the contact is stored |
array | $objectIds | The unique ids of the contact to retrieve. |
The retrieved contact.
getAllAttributeValues(string $field = '', array $sources = array()) : array
Retrieves a list of all possible values of a field in specified source(s).
string | $field | Field name to check. |
array | $sources | Array containing the sources to look in. |
An array of fields and possible values.
listTimeObjects(array $time_categories, mixed $start, mixed $end) : array
Lists birthdays and/or anniversaries as time objects.
array | $time_categories | The time categories (from listTimeObjectCategories) to list. |
mixed | $start | The start date of the period. |
mixed | $end | The end date of the period. |
An array of timeObject results.
searchClients(array $names = array(), array $fields = array(), boolean $matchBegin = false) : array
Search for clients.
array | $names | The search filter values. |
array | $fields | The fields to search in. |
boolean | $matchBegin | Match word boundaries only. |
A hash containing the search results.
addField(string|array $address = '', string $name = '', string $field = '', string $value = '', string $source = '')
Sets the value of the specified attribute of a contact
string|array | $address | Contact email address(es). |
string | $name | Contact name. |
string | $field | Field to update. |
string | $value | Field value to set. |
string | $source | Contact source. |
getField(string $address = '', string $field = '', array $sources = array(), boolean $strict = false, boolean $multiple = false) : array
Returns a field value.
string | $address | Contact email address. |
string | $field | Field to get. |
array | $sources | Sources to check. |
boolean | $strict | Match the email address strictly. |
boolean | $multiple | Return more than one entry if found and true, return an error if this is false. |
An array of field value(s).
getGroupMemberships(string $user, boolean $parentGroups = false) : array
Returns all contact groups that the specified user is a member of.
string | $user | The user. |
boolean | $parentGroups | Include user as a member of the any parent group as well. |
An array of group identifiers that the specified user is a member of.
getGroupMembers(string $gid, boolean $subGroups = false) : array
Returns a list of all members belonging to a contact group.
string | $gid | The group identifier |
boolean | $subGroups | Also include members of any subgroups? |
An array of group members (identified by email address).
addAddressbook(string $name, array $params = array()) : string
Creates a new addressbook.
string | $name | The display name for the addressbook. |
array | $params | Any addtional parameters needed.
|
The new addressbook's id (share name).
listTagInfo(array $tags = null, $user = null) : array
Retrieve the list of used tag_names, tag_ids and the total number of resources that are linked to that tag.
array | $tags | An optional array of tag_ids. If omitted, all tags will be included. |
$user |
An array containing tag_name, and total
searchTags(array $names, integer $max = 10, integer $from, string $resource_type = '', string $user = null, boolean $raw = false) : array
SearchTags API: Returns an application-agnostic array (useful for when doing a tag search across multiple applications)
The 'raw' results array can be returned instead by setting $raw = true.
array | $names | An array of tag_names to search for. |
integer | $max | The maximum number of resources to return. |
integer | $from | The number of the resource to start with. |
string | $resource_type | The resource type [bookmark, ''] |
string | $user | Restrict results to resources owned by $user. |
boolean | $raw | Return the raw data? |
An array of results:
'title' - The title for this resource. 'desc' - A terse description of this resource. 'view_url' - The URL to view this resource. 'app' - The Horde application this resource belongs to. 'icon' - URL to an image.