Constants

SORT_ORDER_ASC

SORT_ORDER_ASC

SORT_ORDER_DESC

SORT_ORDER_DESC

Properties

$_params

$_params : array

Parameters

Type

array

$_db

$_db : \Horde_Db_Adapter

Handle for the current database connection.

Type

\Horde_Db_Adapter

Methods

__construct()

__construct(array  $params = array()) : \Hermes_Driver_Sql

Constructor

Parameters

array $params

A hash containing connection parameters.

  db_adapter => The Horde_Db_Adapter object

Returns

\Hermes_Driver_Sql

The driver object.

getJobTypeByID()

getJobTypeByID(integer  $jobTypeID) : array

Retrieve a specific job type record.

Parameters

integer $jobTypeID

The ID of the job type.

Throws

\Horde_Exception_NotFound

Returns

array —

Hash of job type properties.

getDeliverableByID()

getDeliverableByID(integer  $deliverableID) : array

Retrieve a deliverable by ID.

Parameters

integer $deliverableID

The ID of the deliverable to retrieve.

Throws

\Horde_Exception_NotFound

Returns

array —

Hash of deliverable's properties.

updateJobType()

updateJobType(array  $jobtype) : \The

Add or update a job type record.

Parameters

array $jobtype

A hash of job type properties: 'id' => The ID of the job, if updating. If not present, a new job type is created. 'name' => The job type's name. 'enabled' => Whether the job type is enabled for new time entry.

Returns

\The —

job's ID.

deleteJobType()

deleteJobType(  $jobTypeID) 

Parameters

$jobTypeID

listJobTypes()

listJobTypes(array  $criteria = array()) : array

Return a list of optionally filtered jobtypes.

Parameters

array $criteria

An array of optional criteria. Can include:

  • id: (string) The jobtype id.
  • enabled: (boolean) The enabled property of the jobtype.

Returns

array —

An array of jobtype hashes. Each hash contains the following keys:

  • id: The jobtype id.
  • name: The name.
  • rate: The hourly rate.
  • billable: The billable flag.
  • enabled: The enabled flag.

updateDeliverable()

updateDeliverable(array  $deliverable) : integer

Add or update a deliverable.

Parameters

array $deliverable

A hash of deliverable properties: 'id' => The ID of the deliverable, if updating. If not present, a new ID is allocated. 'name' => The deliverable's display name. 'client_id' => The assigned client ID. 'parent' => ID of the deliverables parent deliverable (if a child). 'estimate' => Estimated number of hours for completion of the deliverable. 'active' => Whether this deliverable is active. 'description' => Text description (notes) for this deliverable.

Returns

integer —

ID of new or saved deliverable.

listDeliverables()

listDeliverables(array  $criteria = array(),   $stats = false) : array

Retrieve list of deliverables.

Parameters

array $criteria

A hash of search criteria: 'id' => If present, only deliverable with specified ID is searched for. 'client_id' => If present, list is filtered by client ID.

$stats

Returns

array —

Hash of job types.

deleteDeliverable()

deleteDeliverable(integer  $deliverableID) : void

Delete a deliverable.

Parameters

integer $deliverableID

The ID of the deliverable.

Throws

\Hermes_Exception

markAs()

markAs(\<type>  $field, \<type>  $hours) : \<type>

Parameters

\ $field
\ $hours

Returns

\

getClientSettings()

getClientSettings(  $clientID) : array

Fetch client settings from storage.

Parameters

$clientID

Throws

\Hermes_Exception

Returns

array —

A hash of client settings.

updateClientSettings()

updateClientSettings(\<type>  $clientID, \<type>  $enterDescription = 1, string  $exportID = null) : \<type>

Parameters

\ $clientID
\ $enterDescription
string $exportID

Returns

\

purge()

purge() : \<type>

Returns

\

enterTime()

enterTime(string  $employee, array  $info) : \Hermes_Slice

Saves a row of time information.

Parameters

string $employee

The Horde ID of the person who worked the hours.

array $info

The billing information to enter. 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
  • billable: (optional) Whether or not the work is billable hours.
  • description: A short description of the work.
  • note: Any notes.
  • costobject: The costobject id

Throws

\Hermes_Exception

Returns

\Hermes_Slice

The new time slice.

updateTime()

updateTime(array  $info) : \Hermes_Slice

Updates time slice information.

Parameters

array $info

The time information to enter. 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.
  • employee: The employee

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

Throws

\Horde_Exception_PermissionDenied
\Hermes_Exception

Returns

\Hermes_Slice

The updated time slice.

getHours()

getHours(array  $filters = array(), array  $fields = array()) : array

Fetch time slices with optional filter.

Parameters

array $filters

An array of properties to filter on. Each entry is a field => value format. Possible field values: client, jobtype, submitted, exported, billable, start, end, employee, id, costobject.

array $fields

Returns

array —

Array of timeslice objects

_convertFromDriver()

_convertFromDriver(mixed  $value) : mixed

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

Parameters

mixed $value

A value to convert.

Returns

mixed —

The converted value.

_convertToDriver()

_convertToDriver(mixed  $value) : mixed

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

Parameters

mixed $value

A value to convert.

Returns

mixed —

The converted value.

_equalClause()

_equalClause(  $lhs,   $rhs,   $quote = true) 

Parameters

$lhs
$rhs
$quote