PHP Класс Turba_Driver_Imsp, horde

Copyright 2010-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.
Автор: Michael Rubinsky ([email protected])
Наследование: extends Turba_Driver
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$_authenticated boolean Holds if we are authenticated.
$_bookName string The name of the addressbook.
$_capabilities array Driver capabilities.
$_groupField string Holds name of the field indicating an IMSP group.
$_groupValue string Holds value that $_groupField will have if entry is an IMSP group.
$_imsp Horde_Imsp Horde_Imsp object
$_noGroups boolean Used to set if the current search is for contacts only.

Открытые методы

Метод Описание
__construct ( string $name = '', array $params = [] ) Constructs a new Turba imsp driver object.
_sendSearch ( array $criteria ) : array Sends a search request to the server.
checkDefaultShare ( $share, $srcConfig ) : TODO Check if the passed in share is the default share for this source.
createShare ( $share_id, $params ) : Horde_Share Creates a new Horde_Share and creates the address book on the IMSP server.
hasPermission ( integer $perm ) : boolean Checks if the current user has the requested permission on this source.

Защищенные методы

Метод Описание
_aclToHordePerms ( string $acl ) : integer Converts an acl string to a Horde Permissions bitmask.
_add ( array $attributes, array $blob_fields = [], array $date_fields = [] ) Adds the specified contact to the addressbook.
_canAdd ( ) TODO
_countDelimiters ( string $in ) : integer Helper function to count the occurances of the ':' * delimiter in group member entries.
_delete ( $object_key, $object_id ) Deletes the specified object from the IMSP server.
_deleteAll ( ) Deletes the address book represented by this driver from the IMSP server.
_doSearch ( array $criteria, string $glue ) : array Parses the search criteria, requests the individual searches from the server and performs any necessary ANDs / ORs on the results.
_getContactOwner ( ) : string Returns the owner for this contact. For an IMSP source, this should be the name of the address book.
_getDuplicated ( array $names ) : array Returns only those names that are duplicated in $names
_getGroupEmails ( string $emailText ) : array Parses out $emailText into an array of pure email addresses suitable for searching the IMSP datastore with.
_makeKey ( array $attributes ) : string Create an object key for a new object.
_read ( string $key, mixed $ids, string $owner, array $fields, array $blobFields = [] ) : array Reads the given data from the address book and returns the results.
_removeDuplicated ( array $names ) : array Returns an array with all duplicate names removed.
_save ( Turba_Object $object ) : string Saves the specified object to the IMSP server.
_search ( array $criteria, array $fields, array $blobFields = [], $count_only = false ) : array Returns all entries matching $critera.

Описание методов

__construct() публичный Метод

Constructs a new Turba imsp driver object.
public __construct ( string $name = '', array $params = [] )
$name string Source name
$params array Hash containing additional configuration parameters.

_aclToHordePerms() защищенный Метод

Converts an acl string to a Horde Permissions bitmask.
protected _aclToHordePerms ( string $acl ) : integer
$acl string A standard, IMAP style acl string.
Результат integer Horde Permissions bitmask.

_add() защищенный Метод

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() защищенный Метод

TODO
protected _canAdd ( )

_countDelimiters() защищенный Метод

Helper function to count the occurances of the ':' * delimiter in group member entries.
protected _countDelimiters ( string $in ) : integer
$in string The group member entry.
Результат integer The number of ':' in $in.

_delete() защищенный Метод

Deletes the specified object from the IMSP server.
protected _delete ( $object_key, $object_id )

_deleteAll() защищенный Метод

Deletes the address book represented by this driver from the IMSP server.
protected _deleteAll ( )

_doSearch() защищенный Метод

Parses the search criteria, requests the individual searches from the server and performs any necessary ANDs / ORs on the results.
protected _doSearch ( array $criteria, string $glue ) : array
$criteria array Array containing the search criteria.
$glue string Type of search to perform (AND / OR).
Результат array Array containing contact names that match $criteria.

_getContactOwner() защищенный Метод

Returns the owner for this contact. For an IMSP source, this should be the name of the address book.
protected _getContactOwner ( ) : string
Результат string TODO

_getDuplicated() защищенный Метод

Returns only those names that are duplicated in $names
protected _getDuplicated ( array $names ) : array
$names array A nested array of arrays containing names
Результат array Array containing the 'AND' of all arrays in $names

_getGroupEmails() защищенный Метод

Parses out $emailText into an array of pure email addresses suitable for searching the IMSP datastore with.
protected _getGroupEmails ( string $emailText ) : array
$emailText string Single string containing email addressses.
Результат array Pure email address.

_makeKey() защищенный Метод

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.
Результат string A unique ID for the new object.

_read() защищенный Метод

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
$key string The primary key field to use (always 'name' for IMSP).
$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.
Результат array Hash containing the search results.

_removeDuplicated() защищенный Метод

Returns an array with all duplicate names removed.
protected _removeDuplicated ( array $names ) : array
$names array Nested array of arrays containing names.
Результат array Array containg the 'OR' of all arrays in $names.

_save() защищенный Метод

Saves the specified object to the IMSP server.
protected _save ( Turba_Object $object ) : string
$object Turba_Object The object to save/update.
Результат string The object id, possibly updated.

_sendSearch() публичный Метод

Sends a search request to the server.
public _sendSearch ( array $criteria ) : array
$criteria array Array containing the search critera.
Результат array Array containing a list of names that match the search.

checkDefaultShare() публичный Метод

Check if the passed in share is the default share for this source.
public checkDefaultShare ( $share, $srcConfig ) : TODO
Результат TODO

createShare() публичный Метод

Creates a new Horde_Share and creates the address book on the IMSP server.
public createShare ( $share_id, $params ) : Horde_Share
Результат Horde_Share The share object.

hasPermission() публичный Метод

Checks if the current user has the requested permission on this source.
public hasPermission ( integer $perm ) : boolean
$perm integer The permission to check for.
Результат boolean true if user has permission, false otherwise.

Описание свойств

$_authenticated защищенное свойство

Holds if we are authenticated.
protected bool $_authenticated
Результат boolean

$_bookName защищенное свойство

The name of the addressbook.
protected string $_bookName
Результат string

$_capabilities защищенное свойство

Driver capabilities.
protected array $_capabilities
Результат array

$_groupField защищенное свойство

Holds name of the field indicating an IMSP group.
protected string $_groupField
Результат string

$_groupValue защищенное свойство

Holds value that $_groupField will have if entry is an IMSP group.
protected string $_groupValue
Результат string

$_imsp защищенное свойство

Horde_Imsp object
protected Horde_Imsp $_imsp
Результат Horde_Imsp

$_noGroups защищенное свойство

Used to set if the current search is for contacts only.
protected bool $_noGroups
Результат boolean