Class Turba_Driver_sql

Description

Turba directory driver implementation for PHP's PEAR database abstraction layer.

$Horde: turba/lib/Driver/sql.php,v 1.59.10.34 2010/02/13 19:23:21 mrubinsk Exp $

Located in /lib/Driver/sql.php (line 11)

Turba_Driver
   |
   --Turba_Driver_sql
Variable Summary
Method Summary
 integer count ()
 mixed removeUserData (string $user)
 void _add ( $attributes, [ $blob_fields = array()])
 array _buildSearchQuery (string $glue, array $criteria)
 void _canAdd ()
 mixed _convertFromDriver (mixed $value)
 mixed _convertToDriver (mixed $value)
 void _delete ( $object_key,  $object_id)
 mixed _deleteAll ([ $sourceName = null])
 mixed _getTimeObjectTurbaList (Horde_Date $start, Horde_Date $end, string $field)
 void _init ()
 string _makeKey (array $attributes)
 array _read (string $key, mixed $ids, string $owner, array $fields, [ $blob_fields = array()])
 string _save ( $object_key,  $object_id,  $attributes, [ $blob_fields = array()])
 array _search (array $criteria, array $fields, [array $appendWhere = array()])
Variables
array $_capabilities = array(
'delete_all' => true,
'delete_addressbook' => true
)
(line 18)

What can this backend do?


Redefinition of:
Turba_Driver::$_capabilities
What can this backend do?
DB $_db (line 28)

Handle for the database connection.

DB $_write_db (line 36)

Handle for the current database connection, used for writing. Defaults to the same handle as $_db if a separate write database is not required.

Inherited Variables

Inherited from Turba_Driver

Turba_Driver::$alternativeName
Turba_Driver::$approximate
Turba_Driver::$fields
Turba_Driver::$listNameField
Turba_Driver::$map
Turba_Driver::$name
Turba_Driver::$strict
Turba_Driver::$tabs
Turba_Driver::$title
Turba_Driver::$_contact_owner
Turba_Driver::$_count
Turba_Driver::$_params
Methods
count (line 96)

Returns the number of contacts of the current user in this address book.

  • return: The number of contacts that the user owns.
integer count ()

Redefinition of:
Turba_Driver::count()
Returns the number of contacts of the current user in this address book.
removeUserData (line 550)

Remove all entries owned by the specified user.

  • return: True | PEAR_Error
mixed removeUserData (string $user)
  • string $user: The user's data to remove.

Redefinition of:
Turba_Driver::removeUserData()
Remove all entries owned by the specified user.
_add (line 278)

Adds the specified object to the SQL database.

void _add ( $attributes, [ $blob_fields = array()])
  • $attributes
  • $blob_fields

Redefinition of:
Turba_Driver::_add()
Adds the specified contact to the SQL database.
_buildSearchQuery (line 457)

Builds a piece of a search query.

  • return: An SQL fragment and a list of values suitable for binding as an array.
array _buildSearchQuery (string $glue, array $criteria)
  • string $glue: The glue to join the criteria (OR/AND).
  • array $criteria: The array of criteria.
_canAdd (line 312)
  • see: _canAdd()
void _canAdd ()

Redefinition of:
Turba_Driver::_canAdd()
_convertFromDriver (line 526)

Converts a value from the driver's charset to the default charset.

  • return: The converted value.
mixed _convertFromDriver (mixed $value)
  • mixed $value: A value to convert.
_convertToDriver (line 538)

Converts a value from the default charset to the driver's charset.

  • return: The converted value.
mixed _convertToDriver (mixed $value)
  • mixed $value: A value to convert.
_delete (line 320)

Deletes the specified object from the SQL database.

void _delete ( $object_key,  $object_id)
  • $object_key
  • $object_id

Redefinition of:
Turba_Driver::_delete()
Deletes the specified contact from the SQL database.
_deleteAll (line 344)

Deletes all contacts from a specific address book.

  • return: True if the operation worked, PEAR_Error on error
mixed _deleteAll ([ $sourceName = null])
  • $sourceName
_getTimeObjectTurbaList (line 570)

Obtain Turba_List of items to get TimeObjects out of.

  • return: A Tubra_List of objects || PEAR_Error
mixed _getTimeObjectTurbaList (Horde_Date $start, Horde_Date $end, string $field)
  • Horde_Date $start: The starting date.
  • Horde_Date $end: The ending date.
  • string $field: The address book field containing the timeObject information (birthday, anniversary)

Redefinition of:
Turba_Driver::_getTimeObjectTurbaList()
Default implementation for obtaining a Turba_List to get TimeObjects out of.
_init (line 38)
void _init ()

Redefinition of:
Turba_Driver::_init()
Initialize the driver.
_makeKey (line 443)

Creates an object key for a new object.

  • return: A unique ID for the new object.
string _makeKey (array $attributes)
  • array $attributes: The attributes (in driver keys) of the object being added.

Redefinition of:
Turba_Driver::_makeKey()
Creates an object key for a new object.
_read (line 209)

Reads the given data from the SQL database and returns the results.

  • return: Hash containing the search results.
array _read (string $key, mixed $ids, string $owner, array $fields, [ $blob_fields = array()])
  • 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.
  • $blob_fields

Redefinition of:
Turba_Driver::_read()
Reads the given data from the address book and returns the results.
_save (line 395)

Saves the specified object in the SQL database.

  • return: The object id, possibly updated.
string _save ( $object_key,  $object_id,  $attributes, [ $blob_fields = array()])
  • $object_key
  • $object_id
  • $attributes
  • $blob_fields

Redefinition of:
Turba_Driver::_save()
Saves the specified object in the SQL database.
_search (line 131)

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.

  • return: Hash containing the search results.
array _search (array $criteria, array $fields, [array $appendWhere = array()])
  • array $criteria: Array containing the search criteria.
  • array $fields: List of fields to return.
  • array $appendWhere: An additional where clause to append. Array should contain 'sql' and 'params' params are used as bind parameters.

Redefinition of:
Turba_Driver::_search()
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.

Inherited Methods

Inherited From Turba_Driver

 Turba_Driver::Turba_Driver()
 Turba_Driver::add()
 Turba_Driver::canAdd()
 Turba_Driver::checkDefaultShare()
 Turba_Driver::count()
 Turba_Driver::createShare()
 Turba_Driver::delete()
 Turba_Driver::deleteAll()
 Turba_Driver::generateUID()
 Turba_Driver::getBlobs()
 Turba_Driver::getContactOwner()
 Turba_Driver::getCountry()
 Turba_Driver::getCriteria()
 Turba_Driver::getFields()
 Turba_Driver::getName()
 Turba_Driver::getObject()
 Turba_Driver::getObjects()
 Turba_Driver::getParams()
 Turba_Driver::hasCapability()
 Turba_Driver::hasPermission()
 Turba_Driver::listTimeObjects()
 Turba_Driver::makeSearch()
 Turba_Driver::removeUserData()
 Turba_Driver::save()
 Turba_Driver::search()
 Turba_Driver::singleton()
 Turba_Driver::toDriver()
 Turba_Driver::toDriverKeys()
 Turba_Driver::toHash()
 Turba_Driver::toTurbaKeys()
 Turba_Driver::tovCard()
 Turba_Driver::_add()
 Turba_Driver::_canAdd()
 Turba_Driver::_delete()
 Turba_Driver::_getContactOwner()
 Turba_Driver::_getTimeObjectTurbaList()
 Turba_Driver::_getTimeObjectTurbaListFallback()
 Turba_Driver::_init()
 Turba_Driver::_makeKey()
 Turba_Driver::_read()
 Turba_Driver::_save()
 Turba_Driver::_search()
 Turba_Driver::_toTurbaObjects()

Documentation generated on Sun, 30 Jan 2011 05:39:27 +0000 by phpDocumentor 1.4.3