libSmalldb  v0.7-66-gb94d22a
Public Member Functions | Protected Attributes | List of all members
Smalldb Class Reference

Description

The libSmalldb entry point.

Smalldb class manages backends (see AbstractBackend) and provides API to create listings and references from the backends.

Public Member Functions

 setDebugLogger (IDebugLogger $debug_logger)
 Set debug logger. More...
 
 getDebugLogger ()
 Get debug logger. More...
 
 afterReferenceCreated ()
 Get afterReferenceCreated hook. More...
 
 afterListingCreated ()
 Get afterListingCreated hook. More...
 
 registerBackend (AbstractBackend $backend)
 Register a new backend. More...
 
 getBackends ()
 Get list of registered backends. More...
 
 getMachine (string $type)
 Obtain machine from backends. More...
 
 ref (... $argv)
 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...
 
 listing ($query_filters, $filtering_flags=0)
 Create a listing using given query filters via createListing() method. More...
 
 performSelfCheck ()
 Perform a quick self-check to detect most common errors (but not all of them). More...
 

Protected Attributes

 $backends = []
 List of registered backends. More...
 

Member Function Documentation

◆ setDebugLogger()

setDebugLogger ( IDebugLogger  $debug_logger)

Set debug logger.

◆ getDebugLogger()

getDebugLogger ( )

Get debug logger.

◆ afterReferenceCreated()

afterReferenceCreated ( )

Get afterReferenceCreated hook.

◆ afterListingCreated()

afterListingCreated ( )

Get afterListingCreated hook.

◆ registerBackend()

registerBackend ( AbstractBackend  $backend)

Register a new backend.

◆ getBackends()

getBackends ( )

Get list of registered backends.

Returns
AbstractBackend[]

◆ getMachine()

getMachine ( string  $type)

Obtain machine from backends.

Returns
AbstractMachine|null

◆ ref()

ref (   $argv)

Get reference to state machine instance of given type and id.

If the first argument is instance of Reference, this makes copy of it. If the first argument is an array, it will be used instead of all arguments.

These calls are equivalent:

$ref = $this->ref('item', 1, 2, 3);
$ref = $this->ref(array('item', 1, 2, 3));
$ref = $this->ref($this->ref('item', 1, 2, 3)));

◆ nullRef()

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.

◆ listing()

listing (   $query_filters,
  $filtering_flags = 0 
)
final

Create a listing using given query filters via createListing() method.

See also
createListing()
Returns
IListing.

◆ performSelfCheck()

performSelfCheck ( )

Perform a quick self-check to detect most common errors (but not all of them).

This will throw various exceptions on errors.

Returns
array Array with results (machine type -> per-machine results).

Member Data Documentation

◆ $backends

$backends = []
protected

List of registered backends.

See also
AbstractBackend[]