libSmalldb
v2.0.2
|
The libSmalldb entry point.
Smalldb class manages machine providers and uses them to provide a simple lazy way to obtain repositories and references.
Public Member Functions | |
__construct () | |
Smalldb constructor. More... | |
registerGeneratedClassAutoloader (string $namespace, string $directory, bool $prependAutoloader=false) | |
Helper method to register autoloader for generated classes when setting up a DI container. More... | |
registerMachineType (SmalldbProviderInterface $provider, array $aliases=[]) | |
Register machine type and its provider. More... | |
getMachineProvider (string $machineType) | |
Retrieve a machine provider for the given machine type or reference class. More... | |
getReferenceClass (string $type) | |
getDefinition (string $type) | |
getTransitionsDecorator (string $type) | |
getRepository (string $type) | |
ref (string $type, $id) | |
Get reference to state machine instance of given type and id. More... | |
nullRef (string $type) | |
Get reference to non-existent state machine instance of given type. More... | |
getMachineTypes () | |
Generate list of all machines. More... | |
setDebugLogger (?DebugLoggerInterface $debugLogger) | |
getDebugLogger () | |
Static Public Member Functions | |
static | createWithGeneratedClassAutoloader (string $namespace, string $directory, bool $prependAutoloader=false) |
__construct | ( | ) |
Smalldb constructor.
|
static |
registerGeneratedClassAutoloader | ( | string | $namespace, |
string | $directory, | ||
bool | $prependAutoloader = false |
||
) |
Helper method to register autoloader for generated classes when setting up a DI container.
registerMachineType | ( | SmalldbProviderInterface | $provider, |
array | $aliases = [] |
||
) |
Register machine type and its provider.
SmalldbProviderInterface | $provider | |
string[] | $aliases |
getMachineProvider | ( | string | $machineType | ) |
Retrieve a machine provider for the given machine type or reference class.
getReferenceClass | ( | string | $type | ) |
getDefinition | ( | string | $type | ) |
getTransitionsDecorator | ( | string | $type | ) |
getRepository | ( | string | $type | ) |
ref | ( | string | $type, |
$id | |||
) |
Get reference to state machine instance of given type and id.
nullRef | ( | string | $type | ) |
Get reference to non-existent state machine instance of given type.
You may want to invoke 'create' or similar transition using this reference.
getMachineTypes | ( | ) |
Generate list of all machines.
setDebugLogger | ( | ?DebugLoggerInterface | $debugLogger | ) |
getDebugLogger | ( | ) |