spoof
|
Public Member Functions | |
setType ($name, $base, $interface) | |
getType ($type) | |
flushCache () |
Static Public Member Functions | |
static | get ($type, $name) |
Data Fields | |
const | OBJECT_TYPE_LANGUAGE = 'Language' |
const | OBJECT_TYPE_DRIVER = 'Driver' |
const | OBJECT_TYPE_EXECUTOR = 'Executor' |
Static Protected Attributes | |
static | $types |
static | $objects = array() |
This static class facilitates loading database objects. TODO make this class more generic, not just for DB objects
flushCache | ( | ) |
Empties cache
|
static |
Retrieves database object, maintains internal cache of loaded objects for future use
string | $type | type of object to retrieve |
string | $name | name of object to retrieve |
TypeNotFoundException | when $type is invalid |
ClassNotFoundException | when cannot find class definition for valid object type |
NotFoundException | when object gets created but fails the check of implementing a pre-defined interface |
getType | ( | $type | ) |
Gets object type configuration
string | $type | type of object |
\InvalidArgumentException | when $type is not defined |
setType | ( | $name, | |
$base, | |||
$interface | |||
) |
Sets object type configuration
string | $name | name of the object type |
string | $base | namespace or similar prefix of object type |
string | $interface | interface the object must implement |
|
staticprotected |
Internal array where objects are stored and cached.
|
staticprotected |
Base object types allowed.
const OBJECT_TYPE_DRIVER = 'Driver' |
Constant for the driver object type
const OBJECT_TYPE_EXECUTOR = 'Executor' |
Constant for the executor object type
const OBJECT_TYPE_LANGUAGE = 'Language' |
Constant for the language object type