PHP Class Sam_Driver_Amavisd_Sql, horde

Copyright 2003-2016 Horde LLC (http://www.horde.org/) See the enclosed file COPYING for license information (GPL). If you did not receive this file, see http://www.horde.org/licenses/gpl.
Author: Max Kalika ([email protected])
Author: Jan Schneider ([email protected])
Inheritance: extends Sam_Driver_Base
Datei anzeigen Open project: horde/horde

Protected Properties

Property Type Description
$_capabilities array List of the capabilities supported by this driver.
$_db Horde_Db_Adapter Handle for the current database connection.

Public Methods

Method Description
__construct ( string $user, array $params = [] ) Constructor.
booleanToOption ( boolean $boolean ) : mixed Converts a boolean option to a backend specific value.
retrieve ( ) Retrieves user preferences from the backend.
store ( boolean $defaults = false ) Stores user preferences and default values in the backend.

Protected Methods

Method Description
_createUserID ( ) : string Creates an Amavisd-new recipient for policy, whitelist and blacklist storage and retrieval.
_lookupPolicyID ( ) : string | boolean Returns an Amavisd-new policy for storage and retrieval.
_lookupUserID ( ) : string Returns an Amavisd-new recipient for policy, whitelist and blacklist storage and retrieval.
_mapAttributeToField ( string $table, string $attribute ) : string Converts a Sam attribute from a specific table to a field that Amavisd-new will use.
_mapFieldToAttribute ( string $table, string $field ) : string Converts a Amavisd-new field from a specific table to a Sam attribute.
_mapNameToTable ( string $table ) : string Converts a Sam table name to a table name that Amavisd-new will use.

Method Details

__construct() public method

Constructor.
public __construct ( string $user, array $params = [] )
$user string A user name.
$params array Class parameters: - db: (Horde_Db_Adapater) A database handle. - table_map: (array) A map of table and field names. See config/backends.php.

_createUserID() protected method

Creates an Amavisd-new recipient for policy, whitelist and blacklist storage and retrieval.
protected _createUserID ( ) : string
return string The id of the newly created recipient.

_lookupPolicyID() protected method

Returns an Amavisd-new policy for storage and retrieval.
protected _lookupPolicyID ( ) : string | boolean
return string | boolean The results of the of the policy lookup. Can be the ID of the policy, false if not found.

_lookupUserID() protected method

Returns an Amavisd-new recipient for policy, whitelist and blacklist storage and retrieval.
protected _lookupUserID ( ) : string
return string The ID of the found or newly created recipient.

_mapAttributeToField() protected method

Converts a Sam attribute from a specific table to a field that Amavisd-new will use.
protected _mapAttributeToField ( string $table, string $attribute ) : string
$table string The Sam table to lookup.
$attribute string The Sam attribute to convert.
return string The converted Amavisd-new field or the original attribute if no match is found.

_mapFieldToAttribute() protected method

Converts a Amavisd-new field from a specific table to a Sam attribute.
protected _mapFieldToAttribute ( string $table, string $field ) : string
$table string The Sam table to lookup.
$field string The Amavisd-new field to convert.
return string The converted Sam attribute or the original field if no match is found.

_mapNameToTable() protected method

Converts a Sam table name to a table name that Amavisd-new will use.
protected _mapNameToTable ( string $table ) : string
$table string The Sam table to lookup.
return string The converted Amavisd-new table or the original name if no match is found.

booleanToOption() public method

Converts a boolean option to a backend specific value.
public booleanToOption ( boolean $boolean ) : mixed
$boolean boolean The value to convert.
return mixed Y if true and N if false.

retrieve() public method

Retrieves user preferences from the backend.
public retrieve ( )

store() public method

Stores user preferences and default values in the backend.
public store ( boolean $defaults = false )
$defaults boolean Whether to store the global defaults instead of user options. Unused.

Property Details

$_capabilities protected_oe property

List of the capabilities supported by this driver.
protected array $_capabilities
return array

$_db protected_oe property

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