Methods summary
public
array
|
#
sources( boolean $writeable = false )
Returns a list of available sources.
Returns a list of available sources.
Parameters
- $writeable
- Set to true to limit to writeable sources.
Returns
array An array of the available sources.
|
public
array
|
#
fields( string $source = null )
Returns a list of fields avaiable in a source.
Returns a list of fields avaiable in a source.
Parameters
- $source
- The name of the source
Returns
array An array describing the fields.
Throws
|
public
|
#
getDefaultShare( )
Retrieve the UID for the current user's default Turba share.
Retrieve the UID for the current user's default Turba share.
|
public
string
|
#
getGalUid( )
Retrieve the UID for the Global Address List source, or false if none
configured.
Retrieve the UID for the Global Address List source, or false if none
configured.
Returns
string | boolean The UID or false if none configured.
|
public
array
|
#
browse( string $path = '', array $properties = array() )
Browses through Turba's object tree.
Browses through Turba's object tree.
Parameters
- $path
- The path of the tree to browse.
- $properties
- <p>The item properties to return. Defaults to
'name', 'icon', and 'browseable'.</p>
Returns
array Content of the specified path.
Throws
|
public
string
|
#
path_delete( string $path )
Deletes a file from the Turba tree.
Deletes a file from the Turba tree.
Parameters
- $path
- The path to the file.
Returns
string The event's UID.
Throws
|
public
array
|
#
listUids( string|array $sources = null )
Returns an array of UIDs for all contacts that the current user is
authorized to see.
Returns an array of UIDs for all contacts that the current user is
authorized to see.
Parameters
- $sources
- <p>The name(s) of the source(s) to return
contacts of. If left empty, the current
user's sync sources or default source are
used.</p>
Returns
array An array of UIDs for all contacts the user can access.
Throws
|
public
array
|
#
listBy( string $action, integer $timestamp, string|array $sources = null, integer $end = null )
Returns an array of UIDs for contacts that have had $action happen since
$timestamp.
Returns an array of UIDs for contacts that have had $action happen since
$timestamp.
Parameters
- $action
- <p>The action to check for - add, modify, or
delete.</p>
- $timestamp
- The time to start the search.
- $sources
- <p>The source(s) for which to retrieve the
history.</p>
- $end
- The optinal ending timestamp.
Returns
array An array of UIDs matching the action and time criteria.
Throws
|
public
array
|
#
getChanges( integer $start, integer $end )
Method for obtaining all server changes between two timestamps. Basically
a wrapper around listBy(), but returns an array containing all adds,
edits and deletions.
Method for obtaining all server changes between two timestamps. Basically
a wrapper around listBy(), but returns an array containing all adds,
edits and deletions.
Parameters
- $start
- The starting timestamp
- $end
- The ending timestamp.
Returns
array An hash with 'add', 'modify' and 'delete' arrays.
|
public
integer
|
#
getActionTimestamp( string $uid, string $action, string|array $sources = null )
Returns the timestamp of an operation for a given uid an action.
Returns the timestamp of an operation for a given uid an action.
Parameters
- $uid
- The uid to look for.
- $action
- <p>The action to check for - add, modify, or
delete.</p>
- $sources
- <p>The source(s) for which to retrieve the
history.</p>
Returns
integer The timestamp for this action.
Throws
|
public
string
|
#
import( string $content, string $contentType = 'array', string $import_source = null )
Import a contact represented in the specified contentType.
Import a contact represented in the specified contentType.
Parameters
- $content
- The content of the contact.
- $contentType
- <p>What format is the data in? Currently
supports array, text/directory, text/vcard,
text/x-vcard, and activesync.</p>
- $import_source
- <p>$source The source into which the contact will be
imported.</p>
Returns
string The new UID, or false on failure.
Throws
|
public
mixed
|
#
export( string $uid, mixed $contentType, string|array $sources = null, array $fields = null )
Export a contact, identified by UID, in the requested contentType.
Export a contact, identified by UID, in the requested contentType.
Parameters
- $uid
- Identify the contact to export.
- $contentType
- <p>What format should the data be in? Either
a string with one of: - text/directory -
text/vcard - text/x-vcard The first two
produce a vcard3.0 (rfc2426), the second
produces a vcard in old 2.1 format
defined by imc.org Also supports a raw
array</p>
- $sources
- <p>The source(s) from which the contact will
be exported.</p>
- $fields
- <p>Hash of field names and
Horde_SyncMl_Property properties with the
requested fields.</p>
Returns
mixed The requested data.
Throws
|
public
string
|
#
ownVCard( )
Exports the user's own contact as a vCard string.
Exports the user's own contact as a vCard string.
Returns
string The requested vCard data.
Throws
|
public
array
|
#
ownContact( )
Export the user's own contact as a hash
Export the user's own contact as a hash
Returns
array The contact hash.
Throws
|
public
array
|
#
getOwnContactObject( )
Helper function to return the user's own contact object
Helper function to return the user's own contact object
Returns
array A hash containing the Turba_Object representing the
user's own contact and the source that it is from.
Throws
|
public
boolean
|
#
delete( string|array $uid, string|array $sources = null )
Deletes a contact identified by UID.
Deletes a contact identified by UID.
Parameters
- $uid
- <p>Identify the contact to delete, either a
single UID or an array.</p>
- $sources
- <p>The source(s) from which the contact will
be deleted.</p>
Returns
boolean Success or failure.
Throws
|
public
boolean
|
#
replace( string $uid, string $content, string $contentType, string|array $sources = null )
Replaces the contact identified by UID with the content represented in
the specified contentType.
Replaces the contact identified by UID with the content represented in
the specified contentType.
Parameters
- $uid
- Idenfity the contact to replace.
- $content
- The content of the contact.
- $contentType
- <p>What format is the data in? Currently
supports array, text/directory,
text/vcard, text/x-vcard and activesync.</p>
- $sources
- <p>The source(s) where the contact will be
replaced.</p>
Returns
boolean Success or failure.
Throws
|
public
array
|
#
search( array $names = array(), array $sources = array(), array $fields = array(), boolean $matchBegin = false, boolean $forceSource = false, array $returnFields = array(), boolean $count_only = false )
Returns a contact search result.
Returns a contact search result.
Parameters
- $names
- The search filter values.
- $sources
- The sources to search in.
- $fields
- The fields to search on.
- $matchBegin
- Match word boundaries only?
- $forceSource
- <p>Whether to use the specified sources, even
if they have been disabled in the
preferences?</p>
- $returnFields
- <p>Only return these fields. Returns all fields
if empty.</p>
- $count_only
- <p>Only return the count of matching entries,
not the entries themselves.</p>
Returns
array Hash containing the search results.
Throws
|
public
array
|
#
getContact( string $source = null, string $objectId = '' )
Retrieves a contact.
Parameters
- $source
- The source name where the contact is stored
- $objectId
- The unique id of the contact to retrieve
Returns
array The retrieved contact.
Throws
|
public
array
|
#
getContacts( string $source = '', array $objectIds = array() )
Retrieves a set of contacts from a single source.
Retrieves a set of contacts from a single source.
Parameters
- $source
- The source name where the contact is stored
- $objectIds
- The unique ids of the contact to retrieve.
Returns
array The retrieved contact.
Throws
|
public
array
|
#
getAllAttributeValues( string $field = '', array $sources = array() )
Retrieves a list of all possible values of a field in specified
source(s).
Retrieves a list of all possible values of a field in specified
source(s).
Parameters
- $field
- Field name to check
- $sources
- Array containing the sources to look in
Returns
array An array of fields and possible values.
Throws
|
public
array
|
#
listTimeObjectCategories( )
Retrieves a list of available time objects categories
Retrieves a list of available time objects categories
Returns
array An array of all configured time object categories.
|
public
array
|
#
listTimeObjects( array $time_categories, mixed $start, mixed $end )
Lists birthdays and/or anniversaries as time objects.
Lists birthdays and/or anniversaries as time objects.
Parameters
- $time_categories
- <p>The time categories (from
listTimeObjectCategories) to list.</p>
- $start
- The start date of the period.
- $end
- The end date of the period.
Returns
array An array of timeObject results.
Throws
|
public
string
|
#
getClientSource( )
Returns the client source name
Returns the client source name
Returns
string The name of the source to use with the clients api.
|
public
array
|
#
clientFields( )
Returns the available client fields
Returns the available client fields
Returns
array An array describing the fields.
|
public
array
|
#
getClient( string $objectId = '' )
Returns a contact from the client source.
Returns a contact from the client source.
Parameters
- $objectId
- Client unique ID
Returns
array Array of client data.
Throws
|
public
array
|
#
getClients( array $objectIds = array() )
Returns mulitple contacts from the client source
Returns mulitple contacts from the client source
Parameters
- $objectIds
- client unique ids
Returns
array An array of clients data.
Throws
|
public
|
#
addClient( array $attributes = array() )
Adds a client to the client source
Adds a client to the client source
Parameters
- $attributes
- Array containing the client attributes
|
public
boolean
|
#
updateClient( string $objectId = '', array $attributes = array() )
Updates client data
Parameters
- $objectId
- The unique id of the client
- $attributes
- An array of client attributes
Returns
boolean
|
public
boolean
|
#
deleteClient( string $objectId = '' )
Deletes a client
Parameters
- $objectId
- The unique id of the client
Returns
boolean
|
public
array
|
#
searchClients( array $names = array(), array $fields = array(), boolean $matchBegin = false )
Search for clients
Parameters
- $names
- The search filter values
- $fields
- The fields to search in
- $matchBegin
- Match word boundaries only
Returns
array A hash containing the search results.
Throws
|
public
|
#
addField( string|array $address = '', string $name = '', string $field = '', string $value = '', string $source = '' )
Sets the value of the specified attribute of a contact
Sets the value of the specified attribute of a contact
Parameters
- $address
- Contact email address(es).
- $name
- Contact name.
- $field
- Field to update.
- $value
- Field value to set.
- $source
- Contact source.
Throws
|
public
array
|
#
getField( string $address = '', string $field = '', array $sources = array(), boolean $strict = false, boolean $multiple = false )
Returns a field value
Parameters
- $address
- Contact email address
- $field
- Field to get
- $sources
- Sources to check
- $strict
- Match the email address strictly
- $multiple
- <p>Return more than one entry if found and true,
return an error if this is false.</p>
Returns
array An array of field value(s).
Throws
|
public
boolean
|
#
deleteField( string $address = '', string $field = '', array $sources = array() )
Deletes a field value
Parameters
- $address
- Contact email address
- $field
- Field to delete value for
- $sources
- Sources to delete value from
Returns
boolean TODO
Throws
|
public
array
|
#
getSourcesConfig( type $filter = array() )
Obtain an array of $cfgSource entries matching the filter criteria.
Obtain an array of $cfgSource entries matching the filter criteria.
Parameters
- $filter
- A single key -> value hash to filter the sources.
Returns
array
|
public
array
|
#
listShares( integer $perms = Horde_Perms::READ )
Lists all shares the current user has access to.
Lists all shares the current user has access to.
Parameters
Returns
array of Turba_Share objects.
|
public
array
|
#
listUserGroupObjects( )
GroupObject API - Lists all turba lists for the current user that can be
treated as Horde_Group objects.
GroupObject API - Lists all turba lists for the current user that can be
treated as Horde_Group objects.
Returns
array A hash of all visible groups in the form of
group_id => group_name
Throws
Horde_Exception
|
public
array
|
#
getGroupObjects( )
Returns all contact groups.
Returns all contact groups.
Returns
array A list of group hashes.
Throws
|
public
array
|
#
getGroupMemberships( string $user, boolean $parentGroups = false )
Returns all contact groups that the specified user is a member of.
Returns all contact groups that the specified user is a member of.
Parameters
- $user
- The user
- $parentGroups
- <p>Include user as a member of the any
parent group as well.</p>
Returns
array An array of group identifiers that the specified user is a
member of.
Throws
Horde_Exception
|
public
array
|
#
getGroupObject( string $gid )
Returns a contact group hash.
Returns a contact group hash.
Parameters
- $gid
- The group identifier.
Returns
array A hash defining the group.
Throws
|
public
array
|
#
getGroupMembers( string $gid, boolean $subGroups = false )
Returns a list of all members belonging to a contact group.
Returns a list of all members belonging to a contact group.
Parameters
- $gid
- The group identifier
- $subGroups
- Also include members of any subgroups?
Returns
array An array of group members (identified by email address).
Throws
Horde_Exception
|