The Turba_Driver:: class provides a common abstracted interface to the
various directory search drivers.  It includes functions for searching,
adding, removing, and modifying directory entries.
Copyright 2000-2012 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.
	 
	
	Methods summary
	
		| 
			 public 
			
			
			 | 
		#
		__construct( string $name = '', array $params = array() )
			Constructs a new Turba_Driver object. 
			Constructs a new Turba_Driver object. Parameters
					$nameSource name
$params<p>Hash containing additional configuration
                      parameters.</p>
 | 
	
		| 
			 public 
			array
			
			 | 
		#
		getParams( )
			Returns the current driver's additional parameters. 
			Returns the current driver's additional parameters. Returns
					arrayHash containing the driver's additional parameters.
 | 
	
		| 
			 public 
			boolean
			
			 | 
		#
		hasCapability( string $capability )
			Checks if this backend has a certain capability. 
			Checks if this backend has a certain capability. Parameters
					$capabilityThe capability to check for.
Returns
					booleanSupported or not.
 | 
	
		| 
			 public 
			array
			
			 | 
		#
		getBlobs( )
			Returns the attributes that are blob types. 
			Returns the attributes that are blob types. Returns
					arrayList of blob attributes in the array keys.
 | 
	
		| 
			 public 
			array
			
			 | 
		#
		toDriverKeys( array $hash )
			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. 
			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. Parameters
					$hashHash using Turba keys.
Returns
					arrayTranslated version of $hash.
 | 
	
		| 
			 public 
			array
			
			 | 
		#
		makeSearch( array $criteria, string $search_type, array $strict, boolean $match_begin = false )
			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. 
			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. Parameters
					$criteriaHash of criteria using Turba keys.
$search_typeOR search or AND search?
$strictFields that must be matched exactly.
$match_begin<p>Whether to match only at beginning of
                             words.</p>
Returns
					arrayAn array of search criteria.
 | 
	
		| 
			 public 
			string
			
			 | 
		#
		toDriver( string $attribute )
			Translates a single Turba attribute to the driver-specific
counterpart. The translation is based on the contents of
$this->map. This ignores composite fields. 
			Translates a single Turba attribute to the driver-specific
counterpart. The translation is based on the contents of
$this->map. This ignores composite fields. Parameters
					$attributeThe Turba attribute to translate.
Returns
					stringThe driver name for this attribute.
 | 
	
		| 
			 public 
			array
			
			 | 
		#
		toTurbaKeys( array $entry )
			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. 
			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. Parameters
					$entryA hash using driver-specific keys.
Returns
					arrayTranslated version of $entry.
 | 
	
		| 
			 public 
			mixed
			
			 | 
		#
		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 )
			Searches the source based on the provided criteria. 
			Searches the source based on the provided criteria. Parameters
					$search_criteriaHash containing the search criteria.
$sort_order<p>The requested sort order which is passed
                               to Turba_List::sort().</p>
$search_type<p>Do an AND or an OR search (defaults to
                               AND).</p>
$return_fields<p>A list of fields to return; defaults to
                               all fields.</p>
$custom_strictA list of fields that must match exactly.
$match_begin<p>Whether to match only at beginning of
                               words.</p>
$count_only<p>Only return the count of matching entries,
                             not the entries themselves.</p>
Returns
					mixedTurba_List|integer  The sorted, filtered list of search
                                  results or the number of matching
                                  entries (if $count_only is true). Throws | 
	
		| 
			 public 
			array
			
			 | 
		#
		searchDuplicates( )
			Searches the current address book for duplicate entries. 
			Searches the current address book for duplicate entries. Duplicates are determined by comparing email and name or last name and
first name values. Returns
					arrayA hash with the following format:
array('name' => array('John Doe' => Turba_List, ...), ...)
 Throws | 
	
		| 
			 public 
			array
			
			 | 
		#
		listTimeObjects( Horde_Date $start, Horde_Date $end, string $category )
			Returns a list of birthday or anniversary hashes from this source for a
certain period. 
			Returns a list of birthday or anniversary hashes from this source for a
certain period. Parameters
					$startThe start date of the valid period.
$endThe end date of the valid period.
$categoryThe timeObjects category to return.
Returns
					arrayA list of timeObject hashes.
 Throws | 
	
		| 
			 public 
			Turba_List | 
		#
		getTimeObjectTurbaList( Horde_Date $start, Horde_Date $end, string $field )
			Default implementation for obtaining a Turba_List to get TimeObjects
out of. 
			Default implementation for obtaining a Turba_List to get TimeObjects
out of. Parameters
					$startThe starting date.
$endThe ending date.
$field<p>The address book field containing the
                          timeObject information (birthday,
                          anniversary).</p>
ReturnsThrows | 
	
		| 
			 public 
			array
			
			 | 
		#
		getObjects( array $objectIds )
			Retrieves a set of objects from the source. 
			Retrieves a set of objects from the source. Parameters
					$objectIdsThe unique ids of the objects to retrieve.
Returns
					arrayThe array of retrieved objects (Turba_Objects).
 Throws | 
	
		| 
			 public 
			Turba_Object | 
		#
		getObject( string $objectId )
			Retrieves one object from the source. 
			Retrieves one object from the source. Parameters
					$objectIdThe unique id of the object to retrieve.
ReturnsThrows | 
	
		| 
			 public 
			string
			
			 | 
		#
		add( array $attributes )
			Adds a new entry to the contact source. 
			Adds a new entry to the contact source. Parameters
					$attributesThe attributes of the new object to add.
Returns
					stringThe new __key value on success.
 Throws | 
	
		| 
			 public 
			boolean
			
			 | 
		#
		canAdd( )
			Returns ability of the backend to add new contacts. 
			Returns ability of the backend to add new contacts. Returns
					booleanCan backend add?
 | 
	
		| 
			 public 
			
			
			 | 
		#
		delete( string $object_id )
			Deletes the specified entry from the contact source. 
			Deletes the specified entry from the contact source. Parameters
					$object_idThe ID of the object to delete.
Throws | 
	
		| 
			 public 
			
			
			 | 
		#
		deleteAll( string $sourceName = null )
			Deletes all contacts from an address book. 
			Deletes all contacts from an address book. Parameters
					$sourceName<p>The identifier of the address book to
                           delete.  If omitted, will clear the current
                           user's 'default' address book for this
                           source type.</p>
Throws | 
	
		| 
			 public 
			string
			
			 | 
		#
		save( Turba_Object$object )
			Modifies an existing entry in the contact source. 
			Modifies an existing entry in the contact source. Parameters
					$objectThe object to update.
Returns
					stringThe object id, possibly updated.
 Throws | 
	
		| 
			 public 
			array
			
			 | 
		#
		getCriteria( )
			Returns the criteria available for this source except '__key'. 
			Returns the criteria available for this source except '__key'. Returns
					arrayAn array containing the criteria.
 | 
	
		| 
			 public 
			array
			
			 | 
		#
		getFields( )
			Returns all non-composite fields for this source. Useful for importing
and exporting data, etc. 
			Returns all non-composite fields for this source. Useful for importing
and exporting data, etc. Returns
					arrayThe field list.
 | 
	
		| 
			 public 
			Horde_Icalendar_Vcard
			
			 | 
		#
		tovCard( Turba_Object$object, string $version = '2.1', array $fields = null, boolean $skipEmpty = false )
			Exports a given Turba_Object as an iCalendar vCard. 
			Exports a given Turba_Object as an iCalendar vCard. Parameters
					$objectTurba_Object.
$versionThe vcard version to produce.
$fields<p>Hash of field names and
                             Horde_SyncMl_Property properties with the
                             requested fields.</p>
$skipEmptyWhether to skip empty fields.
Returns
					Horde_Icalendar_VcardA vcard object.
 | 
	
		| 
			 public 
			array
			
			 | 
		#
		toHash( Horde_Icalendar_Vcard $vcard )
			Function to convert a Horde_Icalendar_Vcard object into a Turba
Object Hash with Turba attributes suitable as a parameter for add(). 
			Function to convert a Horde_Icalendar_Vcard object into a Turba
Object Hash with Turba attributes suitable as a parameter for add(). Parameters
					$vcard<p>The Horde_Icalendar_Vcard object
                                     to parse.</p>
Returns
					arrayA Turba attribute hash.
 See | 
	
		| 
			 public 
			Horde_ActiveSync_Message_Contact
			
			 | 
		#
		toASContact( Turba_Object$object )
			Convert the contact to an ActiveSync contact message 
			Convert the contact to an ActiveSync contact message Parameters
					$objectThe turba object to convert
Returns
					Horde_ActiveSync_Message_Contact | 
	
		| 
			 public 
			array
			
			 | 
		#
		fromASContact( Horde_ActiveSync_Message_Contact $message )
			Convert an ActiveSync contact message into a hash suitable for
importing via self::add(). 
			Convert an ActiveSync contact message into a hash suitable for
importing via self::add(). Parameters
					$message<p>The contact message
                                                  object.</p>
Returns
					arrayA contact hash.
 | 
	
		| 
			 public 
			boolean
			
			 | 
		#
		hasPermission( integer $perm )
			Checks if the current user has the requested permissions on this
address book. 
			Checks if the current user has the requested permissions on this
address book. Parameters
					$permThe permission to check for.
Returns
					booleanTrue if the user has permission, otherwise false.
 | 
	
		| 
			 public 
			
			
			 | 
		#
		getName( )
			Return the name of this address book.
(This is the key into the cfgSources array) 
			Return the name of this address book.
(This is the key into the cfgSources array) String
						Address book name
 | 
	
		| 
			 public 
			string
			
			 | 
		#
		getContactOwner( )
			Return the owner to use when searching or creating contacts in
this address book. 
			Return the owner to use when searching or creating contacts in
this address book. Returns
					stringContact owner.
 | 
	
		| 
			 public 
			
			
			 | 
		#
		setContactOwner( string $owner )
			Override the contactOwner setting for this driver. 
			Override the contactOwner setting for this driver. Parameters
					$ownerThe contact owner.
 | 
	
		| 
			 public 
			
			
			 | 
		#
		setSourceName( string $name )
			Override the name setting for this driver. 
			Override the name setting for this driver. Parameters
					$name<p>The source name. This is the key into the
                     $cfgSources array.</p>
 | 
	
		| 
			 public 
			Horde_Share
			
			 | 
		#
		createShare( string $share_name, array $params )
			Creates a new Horde_Share for this source type. 
			Creates a new Horde_Share for this source type. Parameters
					$share_nameThe share name
$paramsThe params for the share.
Returns
					Horde_ShareThe share object.
 | 
	
		| 
			 public 
			
			
			 | 
		#
		removeUserData( string $user )
			Remove all entries owned by the specified user. 
			Remove all entries owned by the specified user. Parameters
					$userThe user's data to remove.
Throws | 
	
		| 
			 public 
			boolean
			
			 | 
		#
		checkDefaultShare( Horde_Share_Object $share, array $srcconfig )
			Check if the passed in share is the default share for this source. 
			Check if the passed in share is the default share for this source. Parameters
					$shareThe share object.
$srcconfigThe cfgSource entry for the share.
Returns
					booleanTODO
 | 
	
		| 
			 public 
			integer
			
			 | 
		#
		count( )
			Returns the number of contacts of the current user in this address book. 
			Returns the number of contacts of the current user in this address book. Returns
					integerThe number of contacts that the user owns.
 ThrowsImplementation ofCountable::count()
 |