Documentation

Horde_Core_Factory_Db extends Horde_Core_Factory_Base
in package

A Horde_Injector:: based factory for creating Horde_Db_Adapter objects.

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

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

Tags
category

Horde

author

Michael Slusarz slusarz@horde.org

license

http://www.horde.org/licenses/lgpl21 LGPL 2.1

Table of Contents

Properties

$_injector  : Horde_Injector
The injector.
$_instances  : array<string|int, mixed>
Instances.

Methods

__construct()  : mixed
Constructor.
create()  : Horde_Db_Adapter
Returns the DB instance.
createDb()  : mixed
getConfig()  : mixed
_createDb()  : mixed
_getDriverName()  : string
Return the classname of the driver to load.

Properties

$_injector

The injector.

protected Horde_Injector $_injector

$_instances

Instances.

private array<string|int, mixed> $_instances = array()

Methods

__construct()

Constructor.

public __construct(Horde_Injector $injector) : mixed
Parameters
$injector : Horde_Injector

The injector to use.

create()

Returns the DB instance.

public create([string $app = 'horde' ][, string|array<string|int, mixed> $backend = null ]) : Horde_Db_Adapter
Parameters
$app : string = 'horde'

The application.

$backend : string|array<string|int, mixed> = null

The backend, see Horde::getDriverConfig(). If this is an array, this is used as the configuration array.

Tags
throws
Horde_Exception
throws
Horde_Db_Exception
Return values
Horde_Db_Adapter

The singleton instance.

createDb()

public createDb(mixed $config) : mixed
Parameters
$config : mixed

getConfig()

public getConfig(mixed $backend) : mixed
Parameters
$backend : mixed

_createDb()

protected _createDb(mixed $config[, string $sig = null ][, bool $cache = true ]) : mixed
Parameters
$config : mixed
$sig : string = null

Save instance under this signature key.

$cache : bool = true

Add default cache to driver?

_getDriverName()

Return the classname of the driver to load.

protected _getDriverName(string $driver, string $base) : string
Parameters
$driver : string

Driver name.

$base : string

The base classname.

Tags
throws
Horde_Exception
Return values
string

Classname.


        
On this page

Search results