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

Description

Smalldb Backend which loads state machine definitions from a directory full of JSON files and other files included by the JSON files; each JSON file defines a one state machine type.

JsonDirBackend supports following file types:

Inheritance diagram for JsonDirBackend

Public Member Functions

 initializeBackend (array $config, JsonDirReader $custom_json_dir_reader=null)
 Constructor. More...
 
- Public Member Functions inherited from SimpleBackend
 setStateMachineServiceLocator (ContainerInterface $service_locator=null)
 Set container which is then used to instantiate state machines. More...
 
 registerMachineType (string $type, string $class, array $configuration)
 Register new state machine of type $type named $name, which is instance of class $class. More...
 
 registerAllMachineTypes (array $machine_type_table)
 Load all types at once. More...
 
 getKnownTypes ()
 Get all known state machine types. More...
 
 describeType ($type)
 Describe given type without creating an instance of related state machine. More...
 
 inferMachineType ($aref, & $type, & $id)
 Infer type of referenced machine type using lookup table. More...
 
- Public Member Functions inherited from AbstractBackend
 initializeBackend (array $config)
 Configure backend using the $configuration. More...
 
 isBackendInitialized ()
 Is this backend initialized? More...
 
 setDebugLogger (IDebugLogger $debug_logger)
 Set debug logger. More...
 
 getDebugLogger ()
 Get debug logger. More...
 
 afterReferenceCreated ()
 Get afterReferenceCreated hook. More...
 
 afterListingCreated ()
 Get afterListingCreated hook. More...
 
 inferMachineType ($aref, & $type, & $id)
 Infer type of referenced machine type. More...
 
 getCachedMachinesCount ()
 Get number of instantiated machines in cache. More...
 
 getMachine (Smalldb $smalldb, string $type)
 Get state machine of given type, create it if necessary. More...
 
 listing (Smalldb $smalldb, $query_filters, $filtering_flags=0)
 Create a listing using given query filters via createListing() method. More...
 
 performSelfCheck (Smalldb $smalldb)
 Perform a quick self-check to detect most common errors (but not all of them). More...
 
 getKnownTypes ()
 Get all known state machine types. More...
 
 describeType ($type)
 Describe given type without creating an instance of related state machine. More...
 

Additional Inherited Members

- Protected Member Functions inherited from SimpleBackend
 createMachine (Smalldb $smalldb, string $type)
 Factory method: Prepare state machine of given type - a model shared between multiple real statemachines stored in backend. More...
 
 createListing (Smalldb $smalldb, $filters, $filtering_flags=0)
 Creates a listing using given filters. More...
 
- Protected Member Functions inherited from AbstractBackend
 createMachine (Smalldb $smalldb, string $type)
 Factory method: Prepare state machine of given type - a model shared between multiple real statemachines stored in backend. More...
 
 createListing (Smalldb $smalldb, $query_filters, $filtering_flags=0)
 Create a listing using given query filters. More...
 

Member Function Documentation

◆ initializeBackend()

initializeBackend ( array  $config,
JsonDirReader  $custom_json_dir_reader = null 
)

Constructor.

Options:

  • machine_global_config: Config wich will be merged into all state machines
  • cache_disabled: Don't use caching
  • file_readers: File readers map (regexp -> class name)
Parameters
array$configBackend configuration.
JsonDirReader | null$custom_json_dir_reader