Class Hermes_Driver_sql

Description

Hermes storage implementation for PHP's PEAR database abstraction layer.

$Horde: hermes/lib/Driver/sql.php,v 1.67 2008/05/26 01:31:16 chuck Exp $

Required values for $params:

      'phptype'       The database type (e.g. 'pgsql', 'mysql', etc.).

Required by some database implementations:

      'hostspec'      The hostname of the database server.
      'protocol'      The communication protocol ('tcp', 'unix', etc.).
      'database'      The name of the database.
      'username'      The username with which to connect to the database.
      'password'      The password associated with 'username'.
      'options'       Additional options to pass to the database.
      'tty'           The TTY on which to connect to the database.
      'port'          The port on which to connect to the database.

The table structure can be created by the scripts/drivers/hermes.sql script.

  • author: Chuck Hagenbuch <chuck@horde.org

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

Hermes_Driver
   |
   --Hermes_Driver_sql
Variable Summary
 boolean $_connected
 DB $_db
 array $_params
Method Summary
 Hermes_Driver_sql Hermes_Driver_sql ([array $params = array()], string $user)
 void deleteDeliverable ( $deliverableID)
 void deleteJobType ( $jobTypeID)
 mixed enterTime (string $employee,  $info, array $entries)
 void getClientSettings ( $clientID)
 void getHours ([ $filters = array()], [ $fields = array()])
 void listDeliverables ([ $criteria = array()])
 void listJobTypes ([ $criteria = array()])
 void markAs ( $field,  $hours)
 void purge ()
 void updateClientSettings ( $clientID, [ $enterdescription = 1], [ $exportid = null])
 void updateDeliverable ( $deliverable)
 void updateJobType ( $jobtype)
 mixed updateTime (array $entries)
 boolean _connect ()
 boolean _disconnect ()
Variables
boolean $_connected = false (line 47)

Boolean indicating whether or not we're connected to the SQL server.

DB $_db (line 40)

Handle for the current database connection.

array $_params = array() (line 33)

Hash containing connection parameters.

Methods
Constructor Hermes_Driver_sql (line 55)

Constructs a new SQL storage object.

Hermes_Driver_sql Hermes_Driver_sql ([array $params = array()], string $user)
  • string $user: The user who owns these billing.
  • array $params: A hash containing connection parameters.
deleteDeliverable (line 565)
void deleteDeliverable ( $deliverableID)
  • $deliverableID

Redefinition of:
Hermes_Driver::deleteDeliverable()
Delete a deliverable.
deleteJobType (line 450)
void deleteJobType ( $jobTypeID)
  • $jobTypeID
enterTime (line 78)

Save a row of billing information.

  • return: True on success, PEAR_Error on failure.
mixed enterTime (string $employee,  $info, array $entries)
  • string $employee: The Horde ID of the person who worked the hours.
  • array $entries: The billing information to enter. Each array row must contain the following entries: 'date' The day the hours were worked (ISO format) 'client' The id of the client the work was done for. 'type' The type of work done. 'hours' The number of hours worked 'rate' The hourly rate the work was done at. 'billable' (optional) Whether or not the work is billable hours. 'description' A short description of the work.
  • $info
getClientSettings (line 607)
void getClientSettings ( $clientID)
  • $clientID
getHours (line 184)
void getHours ([ $filters = array()], [ $fields = array()])
  • $filters
  • $fields
listDeliverables (line 510)
void listDeliverables ([ $criteria = array()])
  • $criteria

Redefinition of:
Hermes_Driver::listDeliverables()
Retrieve list of deliverables.
listJobTypes (line 370)
void listJobTypes ([ $criteria = array()])
  • $criteria

Redefinition of:
Hermes_Driver::listJobTypes()
Retrieve list of job types.
markAs (line 336)
void markAs ( $field,  $hours)
  • $field
  • $hours
purge (line 675)
void purge ()
updateClientSettings (line 643)
void updateClientSettings ( $clientID, [ $enterdescription = 1], [ $exportid = null])
  • $clientID
  • $enterdescription
  • $exportid
updateDeliverable (line 463)
void updateDeliverable ( $deliverable)
  • $deliverable

Redefinition of:
Hermes_Driver::updateDeliverable()
Add or update a deliverable.
updateJobType (line 416)
void updateJobType ( $jobtype)
  • $jobtype

Redefinition of:
Hermes_Driver::updateJobType()
Add or update a job type record.
updateTime (line 133)

Update a set of billing information.

  • return: True on success, PEAR_Error on failure.
mixed updateTime (array $entries)
  • array $entries:

    The billing information to enter. Each array row must contain the following entries: 'id' The id of this time entry. 'date' The day the hours were worked (ISO format) 'client' The id of the client the work was done for. 'type' The type of work done. 'hours' The number of hours worked 'rate' The hourly rate the work was done at. 'billable' Whether or not the work is billable hours. 'description' A short description of the work.

    If any rows contain a 'delete' entry, those rows will be deleted instead of updated.

_connect (line 694)

Attempts to open a persistent connection to the SQL server.

  • return: True on success; exits (Horde::fatal()) on error.
boolean _connect ()
_disconnect (line 738)

Disconnect from the SQL server and clean up the connection.

  • return: True on success, false on failure.
boolean _disconnect ()

Inherited Methods

Inherited From Hermes_Driver

 Hermes_Driver::deleteDeliverable()
 Hermes_Driver::factory()
 Hermes_Driver::getDeliverableByID()
 Hermes_Driver::getJobTypeByID()
 Hermes_Driver::listDeliverables()
 Hermes_Driver::listJobTypes()
 Hermes_Driver::singleton()
 Hermes_Driver::updateDeliverable()
 Hermes_Driver::updateJobType()

Documentation generated on Sun, 30 Jan 2011 05:25:49 +0000 by phpDocumentor 1.4.3