PHP Class Turba_Driver_Share, horde

Copyright 2009-2016 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.
Author: Chuck Hagenbuch ([email protected])
Author: Jon Parise ([email protected])
Author: Michael J. Rubinsky ([email protected])
Inheritance: extends Turba_Driver
显示文件 Open project: horde/horde

Protected Properties

Property Type Description
$_driver Turba_Driver Underlying driver object for this source.
$_share Horde_Share Horde_Share object for this source.

Public Methods

Method Description
__call ( string $method, array $args ) : mixed Proxy to decorated base driver.
__construct ( string $name = '', array $params = [] ) : Turba_Driver Constructor
getName ( ) Return the name of this address book.
getTimeObjectTurbaList ( Horde_Date $start, Horde_Date $end, string $field ) : Turba_List Obtains 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.
removeUserData ( string $user ) Remove all data for a specific user.
searchDuplicates ( ) : array Searches the current address book for duplicate entries.
setDefaultShare ( string $share ) Runs any actions after setting a new default tasklist.
synchronize ( mixed $token = false ) Synchronize, if needed.
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 ( ) : 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 ( string $sourceName = null ) : array Deletes all contacts from a specific address book.
_getContactOwner ( ) : string Return the owner to use when searching or creating contacts in this address book.
_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.

Method Details

__call() public method

Proxy to decorated base driver.
public __call ( string $method, array $args ) : mixed
$method string Method name.
$args array Method arguments.
return mixed Method result.

__construct() public method

Constructor
public __construct ( string $name = '', array $params = [] ) : Turba_Driver
$name string The source name
$params array The parameter array describing the source
return Turba_Driver

_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

Returns ability of the backend to add new contacts.
protected _canAdd ( ) : boolean
return boolean Can backend add?

_delete() protected method

Deletes the specified contact from the addressbook.
protected _delete ( string $object_key, string $object_id )
$object_key string TODO
$object_id string TODO

_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

_getContactOwner() protected method

Return the owner to use when searching or creating contacts in this address book.
protected _getContactOwner ( ) : string
return string TODO

_makeKey() protected method

Creates 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.

_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.

getName() public method

Return the name of this address book.
public getName ( )

getTimeObjectTurbaList() public method

Obtains a Turba_List to get TimeObjects out of.
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.

hasCapability() public method

Checks if this backend has a certain capability.
public hasCapability ( string $capability ) : boolean
$capability string The capability to check for.
return boolean Supported or not.

hasPermission() public method

Checks if the current user has the requested permissions on this address book.
public hasPermission ( integer $perm ) : boolean
$perm integer The permission to check for.
return boolean True if the user has permission, otherwise false.

removeUserData() public method

Remove all data for a specific user.
public removeUserData ( string $user )
$user string The user to remove all data for.

searchDuplicates() public method

Duplicates are determined by comparing email and name or last name and first name values.
public searchDuplicates ( ) : array
return array A hash with the following format: array('name' => array('John Doe' => Turba_List, ...), ...)

setDefaultShare() public method

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

synchronize() public method

Synchronize, if needed.
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

$_driver protected_oe property

Underlying driver object for this source.
protected Turba_Driver $_driver
return Turba_Driver

$_share protected_oe property

Horde_Share object for this source.
protected Horde_Share $_share
return Horde_Share