Factory
in package
The Factory is a caching root object for Mapper instances This should itself be injected into applications by an injector
Tags
Table of Contents
- $_adapter : Horde_Db_Adapter
- The database connection to pass to the Mapper classes
- $_mappers : array<string|int, mixed>
- The list of already loaded Mapper classes
- __construct() : Factory
- Constructor.
- count() : int
- Counts the number of cached mappers.
- create() : Mapper
- Return the mapper instance.
Properties
$_adapter
The database connection to pass to the Mapper classes
protected
Horde_Db_Adapter
$_adapter
$_mappers
The list of already loaded Mapper classes
protected
array<string|int, mixed>
$_mappers
= array()
Methods
__construct()
Constructor.
public
__construct(Horde_Db_Adapter $adapter) : Factory
Parameters
- $adapter : Horde_Db_Adapter
-
A database adapter.
Return values
Factory —The Factory
count()
Counts the number of cached mappers.
public
count() : int
Return values
int —The number of cached mappers.
create()
Return the mapper instance.
public
create(string $class[, Horde_Db_Adapter $adapter = null ]) : Mapper
Parameters
- $class : string
-
The mapper class.
- $adapter : Horde_Db_Adapter = null
-
A database adapter.
Tags
Return values
Mapper —The Mapper descendant instance.