\Shout_Driver

Shout_Driver:: defines an API for implementing storage backends for Shout.

Copyright 2005-2010 Alkaloid Networks LLC (http://projects.alkaloid.net)

See the enclosed file LICENSE for license information (BSD). If you did not receive this file, see http://www.opensource.org/licenses/bsd-license.php.

Summary

Methods
Properties
Constants
__construct()
getAccounts()
checkAccountType()
getUsers()
getHomeAccount()
getAccountProperties()
getDialplan()
saveExtension()
deleteExtension()
saveDevice()
deleteDevice()
factory()
$_params
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$_params

$_params : array

Hash containing connection parameters.

Type

array

Methods

__construct()

__construct(  $params = array()) 

Parameters

$params

getAccounts()

getAccounts(  $filters = "all",   $filterperms = null) : array

Get a list of accounts from the instantiated driver and filter the returned accounts for those which the current user can see/edit

Parameters

$filters
$filterperms

Returns

array —

Accounts valid for this user

checkAccountType()

checkAccountType(string  $account, string  $type) : boolean

For the given account and type, make sure the account has the appropriate properties, that it is effectively of that "type"

Parameters

string $account

the account to check type for

string $type

the type to verify the account is of

Returns

boolean —

true of the account is of type, false if not

getUsers()

getUsers(string  $account) : array

Get a list of users valid for the current account. Return an array indexed by the extension.

Parameters

string $account

Account for which users should be returned

Returns

array —

User information indexed by voice mailbox number

getHomeAccount()

getHomeAccount() : string

Returns the name of the user's default account

Returns

string —

User's default account

getAccountProperties()

getAccountProperties(string  $account) : integer

Get a account's properties

Parameters

string $account

Account for which to get properties

Returns

integer —

Bitfield of properties valid for this account

getDialplan()

getDialplan(string  $account) : array

Get a account's extensions and return as a multi-dimensional associative array

Parameters

string $account

account to return extensions for

Returns

array —

Multi-dimensional associative array of extensions data

saveExtension()

saveExtension(string  $account, string  $extension, array  $details) : TRUE

Save an extension to the backend.

This method is intended to be overridden by a child class. However it also implements some basic checks, so a typical backend will still call this method via parent::

Parameters

string $account

Account to which the user should be added

string $extension

Extension to be saved

array $details

Phone numbers, PIN, options, etc to be saved

Throws

\Shout_Exception

Returns

TRUE —

on success, PEAR::Error object on error

deleteExtension()

deleteExtension(  $account,   $extension) 

Parameters

$account
$extension

saveDevice()

saveDevice(string  $account,   $devid, array  $details) : TRUE

Save a device to the backend.

This method is intended to be overridden by a child class. However it also implements some basic checks, so a typical backend will still call this method via parent::

Parameters

string $account

Account to which the user should be added

$devid
array $details

Phone numbers, PIN, options, etc to be saved

Throws

\Shout_Exception

Returns

TRUE —

on success, PEAR::Error object on error

deleteDevice()

deleteDevice(\<type>  $account, \<type>  $devid) 

Delete a device from the backend.

This method is intended to be overridden by a child class. However it also implements some basic checks, so a typical backend will still call this method via parent::

Parameters

\ $account
\ $devid

factory()

factory(  $class, string  $driver = null, array  $params = null) : mixed

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

Parameters

$class
string $driver

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

array $params

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

Returns

mixed —

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