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

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

Свойство Тип Описание
$_capabilities array What can this backend do?
$_countCache array count() cache.
$_db Horde_Db_Adapter Handle for the current database connection.

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

Метод Описание
__construct ( string $name = '', array $params = [] ) Constructor.
count ( ) : integer Returns the number of contacts of the current user in this address book.
getTimeObjectTurbaList ( Horde_Date $start, Horde_Date $end, string $field ) : Turba_List Obtain Turba_List of items to get TimeObjects out of.
removeUserData ( string $user ) Remove all entries owned by the specified user.
searchDuplicates ( ) : array Searches the current address book for duplicate entries.

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

Метод Описание
_add ( array $attributes, array $blob_fields = [], array $date_fields = [] ) Adds the specified object to the SQL database.
_buildFields ( array $array ) : array Prepares field lists for searchDuplicates().
_buildJoin ( array $array ) : array Builds the JOIN conditions for searchDuplicates().
_buildSearchQuery ( string $glue, array $criteria ) : array Builds a piece of a search query.
_buildWhere ( array $array ) : array Builds the WHERE conditions for searchDuplicates().
_canAdd ( ) TODO
_convertFromDriver ( mixed $value ) : mixed Converts a value from the driver's charset to the default charset.
_convertToDriver ( mixed $value ) : mixed Converts a value from the default charset to the driver's charset.
_delete ( $object_key, $object_id ) Deletes the specified object from the SQL database.
_deleteAll ( string $sourceName = null ) : array Deletes all contacts from a specific address book.
_internalSearch ( array $criteria, array $fields, array $blobFields = [], array $appendWhere = [], boolean $count_only = false ) : mixed Searches the SQL database with the given criteria and returns a filtered list of results. If the criteria parameter is an empty array, all records will be returned.
_makeKey ( array $attributes ) : string Creates an object key for a new object.
_parseRead ( $blobFields, $result, $dateFields = [] )
_prepareWrite ( $attributes, $blob_fields, $date_fields )
_read ( string $key, mixed $ids, string $owner, array $fields, array $blobFields = [], array $dateFields = [] ) : array Reads the given data from the SQL database 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 SQL database with the given criteria and returns a filtered list of results. If the criteria parameter is an empty array, all records will be returned.

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

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

Constructor.
public __construct ( string $name = '', array $params = [] )
$name string The source name
$params array Additional parameters needed:
'db' - (Horde_Db_Adapter) A DB Adapter object.

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

Adds the specified object to the SQL database.
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

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

Prepares field lists for searchDuplicates().
protected _buildFields ( array $array ) : array
$array array A list of field names.
Результат array A prepared list of field names.

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

Builds the JOIN conditions for searchDuplicates().
protected _buildJoin ( array $array ) : array
$array array A list of field names.
Результат array A list of JOIN conditions.

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

Builds a piece of a search query.
protected _buildSearchQuery ( string $glue, array $criteria ) : array
$glue string The glue to join the criteria (OR/AND).
$criteria array The array of criteria.
Результат array An SQL fragment and a list of values suitable for binding as an array.

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

Builds the WHERE conditions for searchDuplicates().
protected _buildWhere ( array $array ) : array
$array array A list of field names.
Результат array A list of WHERE conditions.

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

TODO
protected _canAdd ( )

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

Converts a value from the driver's charset to the default charset.
protected _convertFromDriver ( mixed $value ) : mixed
$value mixed A value to convert.
Результат mixed The converted value.

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

Converts a value from the default charset to the driver's charset.
protected _convertToDriver ( mixed $value ) : mixed
$value mixed A value to convert.
Результат mixed The converted value.

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

Deletes the specified object from the SQL database.
protected _delete ( $object_key, $object_id )

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

Deletes all contacts from a specific address book.
protected _deleteAll ( string $sourceName = null ) : array
$sourceName string The source to remove all contacts from.
Результат array An array of UIDs

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

Searches the SQL database with the given criteria and returns a filtered list of results. If the criteria parameter is an empty array, all records will be returned.
protected _internalSearch ( array $criteria, array $fields, array $blobFields = [], array $appendWhere = [], boolean $count_only = false ) : mixed
$criteria array Array containing the search criteria.
$fields array List of fields to return.
$blobFields array TODO
$appendWhere array An additional where clause to append. Array should contain 'sql' and 'params' params are used as bind parameters.
$count_only boolean Only return the count of matching entries, not the entries themselves.
Результат mixed array|integer Hash containing the search results or the count of matching entries.

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

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

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

protected _parseRead ( $blobFields, $result, $dateFields = [] )

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

protected _prepareWrite ( $attributes, $blob_fields, $date_fields )

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

Reads the given data from the SQL database 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
Результат array Hash containing the search results.

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

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

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

Returns the number of contacts of the current user in this address book.
public count ( ) : integer
Результат integer The number of contacts that the user owns.

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

Obtain Turba_List of items 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)
Результат Turba_List Object list.

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

Remove all entries owned by the specified user.
public removeUserData ( string $user )
$user string The user's data to remove.

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

Duplicates are determined by comparing email and name or last name and first name values.
public searchDuplicates ( ) : array
Результат array A hash with the following format: array('name' => array('John Doe' => Turba_List, ...), ...)

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

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

What can this backend do?
protected array $_capabilities
Результат array

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

count() cache.
protected array $_countCache
Результат array

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

Handle for the current database connection.
protected Horde_Db_Adapter $_db
Результат Horde_Db_Adapter