PHP Class Vilma_Driver_Sql, horde

See the enclosed file LICENSE for license information (BSD). If you did did not receive this file, see http://www.horde.org/licenses/bsd.
Author: Marko Djukic ([email protected])
Inheritance: extends Vilma_Driver
Afficher le fichier Open project: horde/horde Class Usage Examples

Protected Properties

Свойство Type Description
$_db Horde_Db

Méthodes publiques

Méthode Description
__construct ( array $params ) Constructor.
deleteUser ( integer $user_id ) Deletes a user.
deleteVirtual ( integer $virtual_id ) Deletes a virtual email.
getDomain ( integer $domain_id ) : array Returns the specified domain information from the backend.
getDomainByName ( $domain_name ) : array Given a domain name returns the information from the backend.
getDomainNumUsers ( string $domain_name ) : integer Returns the current number of users for a domain.
getDomains ( ) : array Returns the list of domains from the backend.
getUser ( integer $user_id ) : array Returns the user information for a given user id.
getUsers ( string $domain = null ) : array Returns all available users, if a domain name is passed then limit the list of users only to those users.
getVirtual ( integer $virtual_id ) : array Returns information for a virtual id.
getVirtuals ( string $filter ) : array Returns available virtual emails.
saveVirtual ( array $info, string $domain ) Saves virtual email address to the backend.

Méthodes protégées

Méthode Description
_deleteDomain ( integer $domain_id ) Deletes a domain.
_getAddresses ( string $domain, string $type = 'all' ) : array Returns a list of all users, aliases, or groups and forwards for a domain.
_getTableField ( $table, $field ) : string Returns the real name of a field from a specific table for SQL statements.
_getTableFields ( $table ) : string Returns the list of fields from a specific table for SQL statements.
_initialize ( ) Initializes this backend, connects to the SQL database.
_prepareRecord ( $table, $record ) : array
_saveDomain ( array $info ) Saves a domain with the provided information.
_saveUser ( array $info ) : string Saves a user to the backend.

Method Details

__construct() public méthode

Constructor.
public __construct ( array $params )
$params array Any parameters needed for this driver.

_deleteDomain() protected méthode

Deletes a domain.
protected _deleteDomain ( integer $domain_id )
$domain_id integer The id of the domain to delete.

_getAddresses() protected méthode

Returns a list of all users, aliases, or groups and forwards for a domain.
protected _getAddresses ( string $domain, string $type = 'all' ) : array
$domain string Domain on which to search.
$type string Only return a specific type. One of 'all', 'user', 'alias','forward', or 'group'.
Résultat array Account information for this domain

_getTableField() protected méthode

Returns the real name of a field from a specific table for SQL statements.
protected _getTableField ( $table, $field ) : string
Résultat string

_getTableFields() protected méthode

Returns the list of fields from a specific table for SQL statements.
protected _getTableFields ( $table ) : string
Résultat string

_initialize() protected méthode

Initializes this backend, connects to the SQL database.
protected _initialize ( )

_prepareRecord() protected méthode

protected _prepareRecord ( $table, $record ) : array
Résultat array

_saveDomain() protected méthode

Saves a domain with the provided information.
protected _saveDomain ( array $info )
$info array Array of details to save the domain.

_saveUser() protected méthode

Saves a user to the backend.
protected _saveUser ( array $info ) : string
$info array The user information to save.
Résultat string The user ID.

deleteUser() public méthode

Deletes a user.
public deleteUser ( integer $user_id )
$user_id integer The id of the user to delete.

deleteVirtual() public méthode

Deletes a virtual email.
public deleteVirtual ( integer $virtual_id )
$virtual_id integer The id of the virtual email to delete.

getDomain() public méthode

Returns the specified domain information from the backend.
public getDomain ( integer $domain_id ) : array
$domain_id integer The id of the domain to fetch.
Résultat array The domain's information in an array.

getDomainByName() public méthode

Given a domain name returns the information from the backend.
public getDomainByName ( $domain_name ) : array
Résultat array The domain's information in an array.

getDomainNumUsers() public méthode

Returns the current number of users for a domain.
public getDomainNumUsers ( string $domain_name ) : integer
$domain_name string The name of the domain for which to get the current number of users.
Résultat integer The current number of users.

getDomains() public méthode

Returns the list of domains from the backend.
public getDomains ( ) : array
Résultat array All the domains and their data in an array.

getUser() public méthode

Returns the user information for a given user id.
public getUser ( integer $user_id ) : array
$user_id integer The id of the user for which to fetch information.
Résultat array The user information.

getUsers() public méthode

Returns all available users, if a domain name is passed then limit the list of users only to those users.
public getUsers ( string $domain = null ) : array
$domain string The name of the domain for which to fetch the users.
Résultat array The available users and their stored information.

getVirtual() public méthode

Returns information for a virtual id.
public getVirtual ( integer $virtual_id ) : array
$virtual_id integer The virtual id for which to return information.
Résultat array The virtual email information.

getVirtuals() public méthode

Returns available virtual emails.
public getVirtuals ( string $filter ) : array
$filter string If passed a domain then return all virtual emails for the domain, otherwise if passed a user name return all virtual emails for that user.
Résultat array The available virtual emails.

saveVirtual() public méthode

Saves virtual email address to the backend.
public saveVirtual ( array $info, string $domain )
$info array The virtual email data.
$domain string The name of the domain for this virtual email.

Property Details

$_db protected_oe property

protected Horde_Db $_db
Résultat Horde_Db