Horde_Core_Factory_DbPear
extends Horde_Core_Factory_Base
in package
A Horde_Injector:: based factory for creating PEAR DB 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
Table of Contents
Properties
- $_injector : Horde_Injector
- The injector.
- $_instances : array<string|int, mixed>
- Instances.
Methods
- __construct() : mixed
- Constructor.
- create() : DB
- Return the DB instance.
- getConfig() : 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()
Return the DB instance.
public
create([string $type = 'rw' ][, string $app = 'horde' ][, mixed $dtype = null ]) : DB
Parameters
- $type : string = 'rw'
-
Either 'read' or 'rw'.
- $app : string = 'horde'
-
The application.
- $dtype : mixed = null
-
The type. If this is an array, this is used as the configuration array.
Tags
Return values
DB —The singleton DB instance.
getConfig()
public
getConfig(mixed $type) : mixed
Parameters
- $type : mixed
_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
Return values
string —Classname.