\Operator_Driver_asterisksql

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

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

Copyright 2008-2017 Horde LLC (http://www.horde.org/)

See the enclosed file LICENSE for license information (GPL). If you did not receive this file, see http://www.horde.org/licenses/gpl.

Summary

Methods
Properties
Constants
getRecords()
getMonthlyCallStats()
factory()
__construct()
getAccountCodes()
No public properties found
No constants found
_getRecords()
_getMonthlyCallStats()
_connect()
_disconnect()
$_params
$_db
$_write_db
$_connected
N/A
No private methods found
No private properties found
N/A

Properties

$_params

$_params : array

Hash containing connection parameters.

Type

array

$_db

$_db : \DB

Handle for the current database connection.

Type

\DB

$_write_db

$_write_db : \DB

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

Type

\DB

$_connected

$_connected : boolean

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

Type

boolean

Methods

getRecords()

getRecords(  $start,   $end,   $accountcode = null,   $dcontext = null,   $rowstart,   $rowlimit = 100) : array

Search the database for call detail records, taking permissions into consideration.

Parameters

$start
$end
$accountcode
$dcontext
$rowstart
$rowlimit

Throws

\Operator_Exception

Returns

array —

[0] contains summary statistics; [1] is an array of the actual call records.

getMonthlyCallStats()

getMonthlyCallStats(  $start,   $end,   $accountcode = null,   $dcontext = null) : array

Get summary call statistics per-month for a given time range, account and destination.

Parameters

$start
$end
$accountcode
$dcontext

Throws

\Operator_Exception|\Horde_Date_Exception

Returns

array —

Array of call statistics. The key of each element is the month name in date('Y-m') format and the value being an array of statistics for calls placed that month.

factory()

factory(string  $driver = null, array  $params = null) : \Operator_Driver

Attempts to return a concrete Operator_Driver instance based on $driver.

Parameters

string $driver

The type of the concrete Operator_Driver subclass to return. The class name is based on the storage driver ($driver). The code is dynamically included.

array $params

A hash containing any additional configuration or connection parameters a subclass might need.

Returns

\Operator_Driver

The newly created concrete Operator_Driver instance, or false on an error.

__construct()

__construct(array  $params = array()) 

Constructs a new SQL storage object.

Parameters

array $params

A hash containing connection parameters.

getAccountCodes()

getAccountCodes() 

_getRecords()

_getRecords(  $start,   $end,   $accountcode = null,   $dcontext = null,   $rowstart,   $rowlimit = null) : array

Get call detail records from the database

Parameters

$start
$end
$accountcode
$dcontext
$rowstart
$rowlimit

Throws

\Operator_Exception|\Horde_Date_Exception

Returns

array —

[0] contains summary statistics; [1] is an array of the actual call records.

_getMonthlyCallStats()

_getMonthlyCallStats(  $start,   $end,   $accountcode = null,   $dcontext = null) : array

Get summary call statistics per-month for a given time range, account and destination.

Parameters

$start
$end
$accountcode
$dcontext

Throws

\Operator_Exception|\Horde_Date_Exception

Returns

array —

Array of call statistics. The key of each element is the month name in date('Y-m') format and the value being an array of statistics for calls placed that month.

_connect()

_connect() : boolean

Attempts to open a connection to the SQL server.

Throws

\Horde_Exception

Returns

boolean —

True on success.

_disconnect()

_disconnect() : boolean

Disconnects from the SQL server and cleans up the connection.

Returns

boolean —

True on success, false on failure.