Property | Type | Description | |
---|---|---|---|
$alternativeName | string | The name of a field to use as an alternative to the name field if that one is empty. | |
$approximate | array | Array of fields to search "approximately" (@see config/backends.php). | |
$fields | array | List of all fields that can be accessed in the backend (excludes composite attributes, etc.). | |
$listNameField | string | The name of a field to store contact list names in if not the default. | |
$map | array | Hash describing the mapping between Turba attributes and driver-specific fields. | |
$strict | array | Array of fields that must match exactly. | |
$tabs | array | Hash with all tabs and their fields. | |
$title | string | The symbolic title of this source. |
Property | Type | Description | |
---|---|---|---|
$_asMap | array | Mapping of Turba attributes to ActiveSync fields. | |
$_capabilities | array | What can this backend do? | |
$_contact_owner | string | Hold the value for the owner of this address book. | |
$_count | integer | Number of contacts in this source. | |
$_name | string | The internal name of this source. | |
$_objectOptions | array | Any additional options passed to Turba_Object constructors. | |
$_params | array | Hash holding the driver's additional parameters. |
Method | Description | |
---|---|---|
__construct ( string $name = '', array $params = [] ) | Constructs a new Turba_Driver object. | |
add ( array $attributes ) : string | Adds a new entry to the contact source. | |
canAdd ( ) : boolean | Returns ability of the backend to add new contacts. | |
checkDefaultShare ( Horde_Share_Object $share, array $srcconfig ) : boolean | Check if the passed in share is the default share for this source. | |
count ( ) : integer | Returns the number of contacts of the current user in this address book. | |
createShare ( string $share_name, array $params ) : Horde_Share | Creates a new Horde_Share for this source type. | |
delete ( string $object_id, boolean $remove_tags = true ) | Deletes the specified entry from the contact source. | |
deleteAll ( string $sourceName = null ) | Deletes all contacts from an address book. | |
fromASContact ( Horde_ActiveSync_Message_Contact $message ) : array | Convert an ActiveSync contact message into a hash suitable for importing via self::add(). | |
getBlobs ( ) : array | Returns the attributes that are blob types. | |
getContactOwner ( ) : string | Return the owner to use when searching or creating contacts in this address book. | |
getCriteria ( ) : array | Returns the criteria available for this source except '__key'. | |
getDateFields ( ) : array | Returns the attributes that represent dates. | |
getFields ( ) : array | Returns all non-composite fields for this source. Useful for importing and exporting data, etc. | |
getName ( ) | Return the name of this address book. | |
getObject ( string $objectId ) : Turba_Object | Retrieves one object from the source. | |
getObjects ( array $objectIds ) : array | Retrieves a set of objects from the source. | |
getParams ( ) : array | Returns the current driver's additional parameters. | |
getTimeObjectTurbaList ( Horde_Date $start, Horde_Date $end, string $field ) : Turba_List | Default implementation for obtaining a Turba_List to get TimeObjects out of. | |
hasCapability ( string $capability ) : boolean | Checks if this backend has a certain capability. | |
hasPermission ( integer $perm ) : boolean | Checks if the current user has the requested permissions on this address book. | |
listTimeObjects ( Horde_Date $start, Horde_Date $end, string $category ) : array | Returns a list of birthday or anniversary hashes from this source for a certain period. | |
makeSearch ( array $criteria, string $search_type, array $strict, boolean $match_begin = false, array $custom_strict = [] ) : array | Takes a hash of Turba key => search value and return a (possibly nested) array, using backend attribute names, that can be turned into a search by the driver. The translation is based on the contents of $this->map, and includes nested OR searches for composite fields. | |
removeUserData ( string $user ) | Remove all entries owned by the specified user. | |
save ( Turba_Object $object ) : string | Modifies an existing entry in the contact source. | |
search ( array $search_criteria, string $sort_order = null, string $search_type = 'AND', array $return_fields = [], array $custom_strict = [], boolean $match_begin = false, boolean $count_only = false ) : mixed | Searches the source based on the provided criteria. | |
searchDuplicates ( ) : array | Searches the current address book for duplicate entries. | |
setContactOwner ( string $owner ) | Override the contactOwner setting for this driver. | |
setDefaultShare ( string $share ) | Runs any actions after setting a new default tasklist. | |
setSourceName ( string $name ) | Override the name setting for this driver. | |
synchronize ( mixed $token = false ) | Synchronize, if needed. | |
toASContact ( Turba_Object $object, array $options = [] ) : Horde_ActiveSync_Message_Contact | Convert the contact to an ActiveSync contact message | |
toDriver ( string $attribute ) : string | Translates a single Turba attribute to the driver-specific counterpart. The translation is based on the contents of $this->map. This ignores composite fields. | |
toDriverKeys ( array $hash ) : array | Translates the keys of the first hash from the generalized Turba attributes to the driver-specific fields. The translation is based on the contents of $this->map. | |
toHash ( Horde_Icalendar_Vcard $vcard ) : array | Function to convert a Horde_Icalendar_Vcard object into a Turba Object Hash with Turba attributes suitable as a parameter for add(). | |
toTurbaKeys ( array $entry ) : array | Translates a hash from being keyed on driver-specific fields to being keyed on the generalized Turba attributes. The translation is based on the contents of $this->map. | |
tovCard ( Turba_Object $object, string $version = '2.1', array $fields = null, boolean $skipEmpty = false ) : Horde_Icalendar_Vcard | Exports a given Turba_Object as an iCalendar vCard. |
Method | Description | |
---|---|---|
_add ( array $attributes, array $blob_fields = [], array $date_fields = [] ) | Adds the specified contact to the addressbook. | |
_canAdd ( ) : boolean | Returns ability of the backend to add new contacts. | |
_delete ( string $object_key, string $object_id ) | Deletes the specified contact from the addressbook. | |
_deleteAll ( ) : array | Deletes all contacts from an address book. | |
_filterTags ( array $objects, array $tags, Array $sort_order = null ) : Turba_List | Returns a Turba_List object containing $objects filtered by $tags. | |
_getContactOwner ( ) : string | Return the owner to use when searching or creating contacts in this address book. | |
_getTimeObjectTurbaListFallback ( Horde_Date $start, Horde_Date $end, string $field ) : Turba_List | Default implementation for obtaining a Turba_List to get TimeObjects out of. | |
_guessName ( array &$hash ) | Helper function for guessing name parts from a single name string. | |
_hasValEnum ( array $valEnum, string $type ) : boolean | Returns whether a ValEnum entry from a DevInf object contains a certain type. | |
_init ( ) | Initialize the driver. | |
_makeKey ( array $attributes ) : string | Creates an object key for a new object. | |
_makeUid ( ) : string | Creates an object UID for a new object. | |
_read ( string $key, mixed $ids, string $owner, array $fields, array $blobFields = [], array $dateFields = [] ) : array | Reads the given data from the address book and returns the results. | |
_save ( Turba_Object $object ) : string | Saves the specified object in the SQL database. | |
_search ( array $criteria, array $fields, array $blobFields = [], boolean $count_only = false ) : array | Searches the address book with the given criteria and returns a filtered list of results. If the criteria parameter is an empty array, all records will be returned. | |
_toTurbaObjects ( array $objects, array $sort_order = null ) : Turba_List | Takes an array of object hashes and returns a Turba_List containing the correct Turba_Objects |
public __construct ( string $name = '', array $params = [] ) | ||
$name | string | Source name |
$params | array | Hash containing additional configuration parameters. |
protected _deleteAll ( ) : array | ||
return | array | An array of UIDs that have been deleted. |
protected _filterTags ( array $objects, array $tags, Array $sort_order = null ) : Turba_List | ||
$objects | array | A hash of objects, as returned by self::_search. |
$tags | array | An array of tags to filter by. |
$sort_order | Array | The sort order to pass to Turba_List::sort. |
return | Turba_List | The filtered Turba_List object. |
protected _getContactOwner ( ) : string | ||
return | string | Contact owner. |
protected _getTimeObjectTurbaListFallback ( Horde_Date $start, Horde_Date $end, string $field ) : Turba_List | ||
$start | Horde_Date | The starting date. |
$end | Horde_Date | The ending date. |
$field | string | The address book field containing the timeObject information (birthday, anniversary). |
return | Turba_List | A list of objects. |
protected _guessName ( array &$hash ) | ||
$hash | array | The attributes array. |
protected _read ( string $key, mixed $ids, string $owner, array $fields, array $blobFields = [], array $dateFields = [] ) : array | ||
$key | string | The primary key field to use. |
$ids | mixed | The ids of the contacts to load. |
$owner | string | Only return contacts owned by this user. |
$fields | array | List of fields to return. |
$blobFields | array | Array of fields containing binary data. |
$dateFields | array | Array of fields containing date data. @since 4.2.0 |
return | array | Hash containing the search results. |
protected _search ( array $criteria, array $fields, array $blobFields = [], boolean $count_only = false ) : array | ||
$criteria | array | Array containing the search criteria. |
$fields | array | List of fields to return. |
$blobFields | array | Array of fields containing binary data. |
$count_only | boolean | Only return the count of matching entries, not the entries themselves. |
return | array | Hash containing the search results. |
protected _toTurbaObjects ( array $objects, array $sort_order = null ) : Turba_List | ||
$objects | array | An array of object hashes (keyed to backend). |
$sort_order | array | Array of hashes describing sort fields. Each
hash has the following fields:
ascending - (boolean) Indicating sort direction. field - (string) Sort field. |
return | Turba_List | A list object. |
public fromASContact ( Horde_ActiveSync_Message_Contact $message ) : array | ||
$message | Horde_ActiveSync_Message_Contact | The contact message object. |
return | array | A contact hash. |
public getContactOwner ( ) : string | ||
return | string | Contact owner. |
public getCriteria ( ) : array | ||
return | array | An array containing the criteria. |
public getDateFields ( ) : array | ||
return | array | List of date attributes in the array keys. |
public getObjects ( array $objectIds ) : array | ||
$objectIds | array | The unique ids of the objects to retrieve. |
return | array | The array of retrieved objects (Turba_Objects). |
public getTimeObjectTurbaList ( Horde_Date $start, Horde_Date $end, string $field ) : Turba_List | ||
$start | Horde_Date | The starting date. |
$end | Horde_Date | The ending date. |
$field | string | The address book field containing the timeObject information (birthday, anniversary). |
return | Turba_List | A list of objects. |
public hasCapability ( string $capability ) : boolean | ||
$capability | string | The capability to check for. |
return | boolean | Supported or not. |
public hasPermission ( integer $perm ) : boolean | ||
$perm | integer | The permission to check for. |
return | boolean | True if the user has permission, otherwise false. |
public listTimeObjects ( Horde_Date $start, Horde_Date $end, string $category ) : array | ||
$start | Horde_Date | The start date of the valid period. |
$end | Horde_Date | The end date of the valid period. |
$category | string | The timeObjects category to return. |
return | array | A list of timeObject hashes. |
public makeSearch ( array $criteria, string $search_type, array $strict, boolean $match_begin = false, array $custom_strict = [] ) : array | ||
$criteria | array | Hash of criteria using Turba keys. |
$search_type | string | OR search or AND search? |
$strict | array | Fields that must be matched exactly. |
$match_begin | boolean | Whether to match only at beginning of words. |
$custom_strict | array | Custom set of fields that are to matched exactly, but are glued using $search_type and 'AND' together with $strict fields. Allows an 'OR' search pm a custom set of $strict fields. |
return | array | An array of search criteria. |
public removeUserData ( string $user ) | ||
$user | string | The user's data to remove. |
public search ( array $search_criteria, string $sort_order = null, string $search_type = 'AND', array $return_fields = [], array $custom_strict = [], boolean $match_begin = false, boolean $count_only = false ) : mixed | ||
$search_criteria | array | Hash containing the search criteria. |
$sort_order | string | The requested sort order which is passed to Turba_List::sort(). |
$search_type | string | Do an AND or an OR search (defaults to AND). |
$return_fields | array | A list of fields to return; defaults to all fields. |
$custom_strict | array | A list of fields that must match exactly. |
$match_begin | boolean | Whether to match only at beginning of words. |
$count_only | boolean | Only return the count of matching entries, not the entries themselves. |
return | mixed | Turba_List|integer The sorted, filtered list of search results or the number of matching entries (if $count_only is true). |
public searchDuplicates ( ) : array | ||
return | array | A hash with the following format:
array('name' => array('John Doe' => Turba_List, ...), ...)
|
public setContactOwner ( string $owner ) | ||
$owner | string | The contact owner. |
public setSourceName ( string $name ) | ||
$name | string | The source name. This is the key into the $cfgSources array. |
public synchronize ( mixed $token = false ) | ||
$token | mixed | A value indicating the last synchronization point, if available. |
public toASContact ( Turba_Object $object, array $options = [] ) : Horde_ActiveSync_Message_Contact | ||
$object | Turba_Object | The turba object to convert |
$options | array | Options: - protocolversion: (float) The EAS version to support DEFAULT: 2.5 - bodyprefs: (array) A BODYPREFERENCE array. DEFAULT: none (No body prefs enforced). - truncation: (integer) Truncate event body to this length DEFAULT: none (No truncation). - device: (Horde_ActiveSync_Device) The device object. |
return | Horde_ActiveSync_Message_Contact |
public toDriverKeys ( array $hash ) : array | ||
$hash | array | Hash using Turba keys. |
return | array | Translated version of $hash. |
public toTurbaKeys ( array $entry ) : array | ||
$entry | array | A hash using driver-specific keys. |
return | array | Translated version of $entry. |
public tovCard ( Turba_Object $object, string $version = '2.1', array $fields = null, boolean $skipEmpty = false ) : Horde_Icalendar_Vcard | ||
$object | Turba_Object | Turba_Object. |
$version | string | The vcard version to produce. |
$fields | array | Hash of field names and Horde_SyncMl_Property properties with the requested fields. |
$skipEmpty | boolean | Whether to skip empty fields. |
return | Horde_Icalendar_Vcard | A vcard object. |
protected static array $_asMap | ||
return | array |
protected array $_capabilities | ||
return | array |
protected string $_contact_owner | ||
return | string |
protected int $_count | ||
return | integer |
protected string $_name | ||
return | string |
protected array $_objectOptions | ||
return | array |
protected array $_params | ||
return | array |
public string $alternativeName | ||
return | string |
public array $approximate | ||
return | array |
public array $fields | ||
return | array |
public string $listNameField | ||
return | string |
public array $map | ||
return | array |
public array $strict | ||
return | array |