PHP Class Hermes_Driver_Sql, horde

See the enclosed file LICENSE for license information (BSD). If you did not receive this file, see http://www.horde.org/licenses/bsdl.php.
Author: Chuck Hagenbuch ([email protected])
Author: Michael J. Rubinsky ([email protected])
Inheritance: extends Hermes_Driver
Datei anzeigen Open project: horde/horde

Protected Properties

Property Type Description
$_db Horde_Db_Adapter Handle for the current database connection.

Public Methods

Method Description
__construct ( array $params = [] ) : Hermes_Driver_Sql Constructor
deleteDeliverable ( $deliverableID )
deleteJobType ( $jobTypeID )
enterTime ( string $employee, array $info ) : integer Save a row of billing information.
getClientSettings ( $clientID ) : array Fetch client settings from storage.
getHours ( array $filters = [], array $fields = [] ) : array Fetch time slices with optional filter.
listDeliverables ( $criteria = [], $stats = false )
listJobTypes ( array $criteria = [] ) : array Return a list of optionally filtered jobtypes.
markAs ( $field, $hours ) :
purge ( ) :
updateClientSettings ( $clientID, $enterDescription = 1, string $exportID = null ) :
updateDeliverable ( $deliverable )
updateJobType ( $jobtype )
updateTime ( array $entries ) : integer Update a set of billing information.

Protected Methods

Method Description
_convertFromDriver ( mixed $value ) : mixed Converts a value from the driver's charset to the default charset.
_convertToDriver ( mixed $value ) : mixed Converts a value from the default charset to the driver's charset.

Private Methods

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

Method Details

__construct() public method

Constructor
public __construct ( array $params = [] ) : Hermes_Driver_Sql
$params array A hash containing connection parameters.
  db_adapter => The Horde_Db_Adapter object
return Hermes_Driver_Sql The driver object.

_convertFromDriver() protected method

Converts a value from the driver's charset to the default charset.
protected _convertFromDriver ( mixed $value ) : mixed
$value mixed A value to convert.
return mixed The converted value.

_convertToDriver() protected method

Converts a value from the default charset to the driver's charset.
protected _convertToDriver ( mixed $value ) : mixed
$value mixed A value to convert.
return mixed The converted value.

deleteDeliverable() public method

See also: Hermes_Driver::updateDeliverable
public deleteDeliverable ( $deliverableID )

deleteJobType() public method

public deleteJobType ( $jobTypeID )

enterTime() public method

Save a row of billing information.
public enterTime ( string $employee, array $info ) : integer
$employee string The Horde ID of the person who worked the hours.
$info array 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
return integer The new timeslice_id of the newly entered slice

getClientSettings() public method

Fetch client settings from storage.
public getClientSettings ( $clientID ) : array
return array A hash of client settings.

getHours() public method

Fetch time slices with optional filter.
public getHours ( array $filters = [], array $fields = [] ) : array
$filters array 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.
$fields array
return array Array of timeslice objects

listDeliverables() public method

See also: Hermes_Driver::listDeliverables()
public listDeliverables ( $criteria = [], $stats = false )

listJobTypes() public method

Return a list of optionally filtered jobtypes.
public listJobTypes ( array $criteria = [] ) : array
$criteria array An array of optional criteria. Can include: - id: (string) The jobtype id. - enabled: (boolean) The enabled property of the jobtype.
return 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.

markAs() public method

public markAs ( $field, $hours ) :
$field
$hours
return

purge() public method

public purge ( ) :
return

updateClientSettings() public method

public updateClientSettings ( $clientID, $enterDescription = 1, string $exportID = null ) :
$clientID
$enterDescription
$exportID string
return

updateDeliverable() public method

See also: Hermes_Driver::updateDeliverable
public updateDeliverable ( $deliverable )

updateJobType() public method

public updateJobType ( $jobtype )

updateTime() public method

Update a set of billing information.
public updateTime ( array $entries ) : integer
$entries array 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. 'employee' The employee If any rows contain a 'delete' entry, those rows will be deleted instead of updated.
return integer The number of successful updates.

Property Details

$_db protected_oe property

Handle for the current database connection.
protected Horde_Db_Adapter $_db
return Horde_Db_Adapter