$title
$title : string
The symbolic title of this source.
Turba directory driver implementation for the Horde_Db database abstraction layer.
Copyright 2010-2017 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.
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.
array | $hash | Hash using Turba keys. |
Translated version of $hash.
makeSearch(array $criteria, string $search_type, array $strict, boolean $match_begin = false, array $custom_strict = array()) : 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.
array | $criteria | Hash of criteria using Turba keys. |
string | $search_type | OR search or AND search? |
array | $strict | Fields that must be matched exactly. |
boolean | $match_begin | Whether to match only at beginning of words. |
array | $custom_strict | 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. |
An array of search criteria.
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.
string | $attribute | The Turba attribute to translate. |
The driver name for this attribute.
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.
array | $entry | A hash using driver-specific keys. |
Translated version of $entry.
search(array $search_criteria, string $sort_order = null, string $search_type = 'AND', array $return_fields = array(), array $custom_strict = array(), boolean $match_begin = false, boolean $count_only = false) : mixed
Searches the source based on the provided criteria.
array | $search_criteria | Hash containing the search criteria. |
string | $sort_order | The requested sort order which is passed to Turba_List::sort(). |
string | $search_type | Do an AND or an OR search (defaults to AND). |
array | $return_fields | A list of fields to return; defaults to all fields. |
array | $custom_strict | A list of fields that must match exactly. |
boolean | $match_begin | Whether to match only at beginning of words. |
boolean | $count_only | Only return the count of matching entries, not the entries themselves. |
Turba_List|integer The sorted, filtered list of search results or the number of matching entries (if $count_only is true).
searchDuplicates() : array
Searches the current address book for duplicate entries.
Duplicates are determined by comparing email and name or last name and first name values.
A hash with the following format:
array('name' => array('John Doe' => Turba_List, ...), ...)
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.
\Horde_Date | $start | The start date of the valid period. |
\Horde_Date | $end | The end date of the valid period. |
string | $category | The timeObjects category to return. |
Exception
A list of timeObject hashes.
getTimeObjectTurbaList(\Horde_Date $start, \Horde_Date $end, string $field) : \Turba_List
Obtain Turba_List of items to get TimeObjects out of.
\Horde_Date | $start | The starting date. |
\Horde_Date | $end | The ending date. |
string | $field | The address book field containing the timeObject information (birthday, anniversary) |
Object list.
getObject(string $objectId) : \Turba_Object
Retrieves one object from the source.
string | $objectId | The unique id of the object to retrieve. |
The retrieved object.
save(\Turba_Object $object) : string
Modifies an existing entry in the contact source.
\Turba_Object | $object | The object to update. |
The object id, possibly updated.
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.
\Turba_Object | $object | Turba_Object. |
string | $version | The vcard version to produce. |
array | $fields | Hash of field names and Horde_SyncMl_Property properties with the requested fields. |
boolean | $skipEmpty | Whether to skip empty fields. |
A vcard object.
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().
\Horde_Icalendar_Vcard | $vcard | The Horde_Icalendar_Vcard object to parse. |
A Turba attribute hash.
toASContact(\Turba_Object $object, array $options = array()) : \Horde_ActiveSync_Message_Contact
Convert the contact to an ActiveSync contact message
\Turba_Object | $object | The turba object to convert |
array | $options | Options:
|
_filterTags(array $objects, array $tags, Array $sort_order = null) : \Turba_List
Returns a Turba_List object containing $objects filtered by $tags.
array | $objects | A hash of objects, as returned by self::_search. |
array | $tags | An array of tags to filter by. |
Array | $sort_order | The sort order to pass to Turba_List::sort. |
The filtered Turba_List object.
_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
array | $objects | An array of object hashes (keyed to backend). |
array | $sort_order | Array of hashes describing sort fields. Each hash has the following fields: ascending - (boolean) Indicating sort direction. field - (string) Sort field. |
A list object.
_getTimeObjectTurbaListFallback(\Horde_Date $start, \Horde_Date $end, string $field) : \Turba_List
Default implementation for obtaining a Turba_List to get TimeObjects out of.
\Horde_Date | $start | The starting date. |
\Horde_Date | $end | The ending date. |
string | $field | The address book field containing the timeObject information (birthday, anniversary). |
A list of objects.
_search(array $criteria, array $fields, array $blobFields = array(), 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.
array | $criteria | Array containing the search criteria. |
array | $fields | List of fields to return. |
array | $blobFields | TODO |
boolean | $count_only | Only return the count of matching entries, not the entries themselves. |
Hash containing the search results.
_read(string $key, mixed $ids, string $owner, array $fields, array $blobFields = array(), array $dateFields = array()) : array
Reads the given data from the SQL database and returns the results.
string | $key | The primary key field to use. |
mixed | $ids | The ids of the contacts to load. |
string | $owner | Only return contacts owned by this user. |
array | $fields | List of fields to return. |
array | $blobFields | Array of fields containing binary data. |
array | $dateFields | Array of fields containing date data. @since 4.2.0 |
Hash containing the search results.
_add(array $attributes, array $blob_fields = array(), array $date_fields = array())
Adds the specified object to the SQL database.
array | $attributes | The attribute values of the contact. |
array | $blob_fields | Fields that represent binary data. |
array | $date_fields | Fields that represent dates. @since 4.2.0 |
_save(\Turba_Object $object) : string
Saves the specified object in the SQL database.
\Turba_Object | $object | The object to save. |
The object id, possibly updated.
_internalSearch(array $criteria, array $fields, array $blobFields = array(), array $appendWhere = array(), 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.
array | $criteria | Array containing the search criteria. |
array | $fields | List of fields to return. |
array | $blobFields | TODO |
array | $appendWhere | An additional where clause to append. Array should contain 'sql' and 'params' params are used as bind parameters. |
boolean | $count_only | Only return the count of matching entries, not the entries themselves. |
array|integer Hash containing the search results or the count of matching entries.
_buildSearchQuery(string $glue, array $criteria) : array
Builds a piece of a search query.
string | $glue | The glue to join the criteria (OR/AND). |
array | $criteria | The array of criteria. |
An SQL fragment and a list of values suitable for binding as an array.