PHP Класс 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.
Автор: Chuck Hagenbuch ([email protected])
Автор: Michael J. Rubinsky ([email protected])
Наследование: extends Hermes_Driver
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$_db Horde_Db_Adapter Handle for the current database connection.

Открытые методы

Метод Описание
__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.

Защищенные методы

Метод Описание
_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.

Приватные методы

Метод Описание
_equalClause ( $lhs, $rhs, $quote = true )

Описание методов

__construct() публичный Метод

Constructor
public __construct ( array $params = [] ) : Hermes_Driver_Sql
$params array A hash containing connection parameters.
  db_adapter => The Horde_Db_Adapter object
Результат Hermes_Driver_Sql The driver object.

_convertFromDriver() защищенный Метод

Converts a value from the driver's charset to the default charset.
protected _convertFromDriver ( mixed $value ) : mixed
$value mixed A value to convert.
Результат mixed The converted value.

_convertToDriver() защищенный Метод

Converts a value from the default charset to the driver's charset.
protected _convertToDriver ( mixed $value ) : mixed
$value mixed A value to convert.
Результат mixed The converted value.

deleteDeliverable() публичный Метод

См. также: Hermes_Driver::updateDeliverable
public deleteDeliverable ( $deliverableID )

deleteJobType() публичный Метод

public deleteJobType ( $jobTypeID )

enterTime() публичный Метод

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
Результат integer The new timeslice_id of the newly entered slice

getClientSettings() публичный Метод

Fetch client settings from storage.
public getClientSettings ( $clientID ) : array
Результат array A hash of client settings.

getHours() публичный Метод

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
Результат array Array of timeslice objects

listDeliverables() публичный Метод

См. также: Hermes_Driver::listDeliverables()
public listDeliverables ( $criteria = [], $stats = false )

listJobTypes() публичный Метод

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.
Результат 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 markAs ( $field, $hours ) :
$field
$hours
Результат

purge() публичный Метод

public purge ( ) :
Результат

updateClientSettings() публичный Метод

public updateClientSettings ( $clientID, $enterDescription = 1, string $exportID = null ) :
$clientID
$enterDescription
$exportID string
Результат

updateDeliverable() публичный Метод

См. также: Hermes_Driver::updateDeliverable
public updateDeliverable ( $deliverable )

updateJobType() публичный Метод

public updateJobType ( $jobtype )

updateTime() публичный Метод

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.
Результат integer The number of successful updates.

Описание свойств

$_db защищенное свойство

Handle for the current database connection.
protected Horde_Db_Adapter $_db
Результат Horde_Db_Adapter