PHP Class Turba_Driver_Kolab, horde

Copyright 2004-2016 Horde LLC (http://www.horde.org/) See the enclosed file LICENSE for license information (ASL). If you did not receive this file, see http://www.horde.org/licenses/apache.
Author: Thomas Jarosch ([email protected])
Author: Gunnar Wrobel ([email protected])
Author: Stuart Binge ([email protected])
Inheritance: extends Turba_Driver
Exibir arquivo Open project: horde/horde

Protected Properties

Property Type Description
$_capabilities array What can this backend do?
$_connected boolean Indicates if the driver has been connected to a specific addressbook or not.
$_contacts_cache array The cached contacts.
$_data Horde_Kolab_Storage_Data The current addressbook.
$_kolab Horde_Kolab_Storage The Kolab_Storage backend.
$_listData Horde_Kolab_Storage_Data The current addressbook, serving groups.
$_objectOptions array Any additional options passed to Turba_Object constructors.
$_share Horde_Share_Object The current addressbook represented as share.

Public Methods

Method Description
__construct ( $name = '', $params = [] ) Attempts to open a Kolab Groupware folder.
checkDefaultShare ( Horde_Share_Object $share, array $srcconfig ) : boolean Check if the passed in share is the default share for this source.
connect ( ) Connect to the Kolab backend.
createShare ( string $share_name, array $params ) : Horde_Share Creates a new Horde_Share for this source type.
setDefaultShare ( string $share ) Runs any actions after setting a new default notepad.
synchronize ( mixed $token = false ) Synchronize with the Kolab backend.
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.
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.

Protected Methods

Method Description
_add ( array $attributes, array $blob_fields = [], array $date_fields = [] ) Adds the specified contact to the addressbook.
_canAdd ( )
_convertMembers ( &$attributes ) TODO
_createData ( string $type ) : Horde_Kolab_Storage_Data Returns a new Kolab data handler for the current address book.
_delete ( $object_key, $object_id ) Removes the specified object from the Kolab message store.
_deleteAll ( string $sourceName = null ) : array Deletes all contacts from a specific address book.
_doSearch ( array $criteria, $glue ) : array Applies the filter criteria to a list of entries
_generateUid ( ) : string Create an object key for a new object.
_getAND ( array $ids ) : array Returns only those names that are duplicated in $ids
_getData ( ) : Horde_Kolab_Storage_Data Returns the Kolab data handler for contacts in the current address book.
_getListData ( ) : Horde_Kolab_Storage_Data Returns the Kolab data handler for distribution lists in the current address book.
_makeKey ( array $attributes ) : string Create 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.
_removeDuplicated ( array $ids ) : array Returns an array with all duplicate names removed.
_save ( Turba_Object $object ) : string Saves the specified object in the SQL database.
_search ( array $criteria, array $fields, array $blobFields = [], $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.
_selectEntries ( $test ) : array Applies one filter criterium to a list of entries
_store ( $attributes, $object_id = null ) : string Stores an object in the Kolab message store.

Method Details

__construct() public method

Attempts to open a Kolab Groupware folder.
public __construct ( $name = '', $params = [] )

_add() protected method

Adds the specified contact to the addressbook.
protected _add ( array $attributes, array $blob_fields = [], array $date_fields = [] )
$attributes array The attribute values of the contact.
$blob_fields array Fields that represent binary data.
$date_fields array Fields that represent dates. @since 4.2.0

_canAdd() protected method

protected _canAdd ( )

_convertMembers() protected method

TODO
protected _convertMembers ( &$attributes )

_createData() protected method

Returns a new Kolab data handler for the current address book.
protected _createData ( string $type ) : Horde_Kolab_Storage_Data
$type string An object type, either 'contact' or 'distribution-list'.
return Horde_Kolab_Storage_Data A data handler.

_delete() protected method

Removes the specified object from the Kolab message store.
protected _delete ( $object_key, $object_id )

_deleteAll() protected method

Deletes all contacts from a specific address book.
protected _deleteAll ( string $sourceName = null ) : array
$sourceName string The source to remove all contacts from.
return array An array of UIDs

_doSearch() protected method

Applies the filter criteria to a list of entries
protected _doSearch ( array $criteria, $glue ) : array
$criteria array Array containing the search criteria.
return array Array containing the ids of the selected entries.

_generateUid() protected method

Create an object key for a new object.
protected _generateUid ( ) : string
return string A unique ID for the new object.

_getAND() protected method

Returns only those names that are duplicated in $ids
protected _getAND ( array $ids ) : array
$ids array A nested array of arrays containing names
return array Array containing the 'AND' of all arrays in $ids

_getData() protected method

Returns the Kolab data handler for contacts in the current address book.
protected _getData ( ) : Horde_Kolab_Storage_Data
return Horde_Kolab_Storage_Data The data handler.

_getListData() protected method

Returns the Kolab data handler for distribution lists in the current address book.
protected _getListData ( ) : Horde_Kolab_Storage_Data
return Horde_Kolab_Storage_Data The data handler.

_makeKey() protected method

Create an object key for a new object.
protected _makeKey ( array $attributes ) : string
$attributes array The attributes (in driver keys) of the object being added.
return string A unique ID for the new object.

_makeUid() protected method

Creates an object UID for a new object.
protected _makeUid ( ) : string
return string A unique ID for the new object.

_read() protected method

Reads the given data from the address book and returns the results.
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.

_removeDuplicated() protected method

Returns an array with all duplicate names removed.
protected _removeDuplicated ( array $ids ) : array
$ids array Nested array of arrays containing names.
return array Array containg the 'OR' of all arrays in $ids.

_save() protected method

Saves the specified object in the SQL database.
protected _save ( Turba_Object $object ) : string
$object Turba_Object The object to save
return string The object id, possibly updated.

_selectEntries() protected method

Applies one filter criterium to a list of entries
protected _selectEntries ( $test ) : array
$test Test criterium
return array Array containing the ids of the selected entries

_store() protected method

TODO
protected _store ( $attributes, $object_id = null ) : string
return string The object id, possibly updated.

checkDefaultShare() public method

Check if the passed in share is the default share for this source.
public checkDefaultShare ( Horde_Share_Object $share, array $srcconfig ) : boolean
$share Horde_Share_Object The share object.
$srcconfig array The cfgSource entry for the share.
return boolean TODO

connect() public method

Connect to the Kolab backend.
public connect ( )

createShare() public method

Creates a new Horde_Share for this source type.
public createShare ( string $share_name, array $params ) : Horde_Share
$share_name string The share name
$params array The params for the share.
return Horde_Share The share object.

setDefaultShare() public method

Runs any actions after setting a new default notepad.
public setDefaultShare ( string $share )
$share string The default share ID.

synchronize() public method

Synchronize with the Kolab backend.
public synchronize ( mixed $token = false )
$token mixed A value indicating the last synchronization point, if available.

toDriverKeys() public method

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.
public toDriverKeys ( array $hash ) : array
$hash array Hash using Turba keys.
return array Translated version of $hash.

toTurbaKeys() public method

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.
public toTurbaKeys ( array $entry ) : array
$entry array A hash using driver-specific keys.
return array Translated version of $entry.

Property Details

$_capabilities protected_oe property

What can this backend do?
protected array $_capabilities
return array

$_connected protected_oe property

Indicates if the driver has been connected to a specific addressbook or not.
protected bool $_connected
return boolean

$_contacts_cache protected_oe property

The cached contacts.
protected array $_contacts_cache
return array

$_data protected_oe property

The current addressbook.
protected Horde_Kolab_Storage_Data $_data
return Horde_Kolab_Storage_Data

$_kolab protected_oe property

The Kolab_Storage backend.
protected Horde_Kolab_Storage $_kolab
return Horde_Kolab_Storage

$_listData protected_oe property

The current addressbook, serving groups.
protected Horde_Kolab_Storage_Data $_listData
return Horde_Kolab_Storage_Data

$_objectOptions protected_oe property

Any additional options passed to Turba_Object constructors.
protected array $_objectOptions
return array

$_share protected_oe property

The current addressbook represented as share.
protected Horde_Share_Object $_share
return Horde_Share_Object