Smalldb  v0.0-177-g1a83180
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Protected Attributes | List of all members
BlockStorage Class Reference

Smalldb block storage generates blocks for each action of each state machine and also few useful blocks for each backend. More...

Inheritance diagram for BlockStorage:
Inheritance graph

Public Member Functions

 __construct ($storage_opts, $context, $alias, $is_write_allowed)
 Constructor will get options from core.ini.php file.
 
 getSmalldbBackend ()
 Get Smalldb backend.
 
 isReadOnly ()
 Returns true if there is no way that this storage can modify or create blocks. More...
 
 createBlockInstance ($block)
 Create instance of requested block and give it loaded configuration. More...
 
 describeBlock ($block)
 Describe block for documentation generator. More...
 
 loadBlock ($block)
 Load block configuration. More...
 
 storeBlock ($block, $config)
 Store block configuration.
 
 deleteBlock ($block)
 Delete block configuration.
 
 blockMTime ($block)
 Get time (unix timestamp) of last modification of the block.
 
 getKnownBlocks (&$blocks=array())
 List all available blocks in this storage.
 

Protected Attributes

 $backend
 Smalldb Backend.
 
 $alias
 Name of this block storage.
 
 $backend_blocks
 Backend-related blocks. More...
 

Detailed Description

Smalldb block storage generates blocks for each action of each state machine and also few useful blocks for each backend.

Member Function Documentation

isReadOnly ( )

Returns true if there is no way that this storage can modify or create blocks.

When creating or modifying block, first storage that returns true will be used.

createBlockInstance (   $block)

Create instance of requested block and give it loaded configuration.

No further initialisation here, that is job for cascade controller. Returns created instance or false.

Todo:
This should not be here
describeBlock (   $block)

Describe block for documentation generator.

Todo:
loadBlock (   $block)

Load block configuration.

Returns false if block is not found.

Member Data Documentation

$backend_blocks
protected
Initial value:
= array(
'router_factory' => 'RouterFactoryBlock',
'listing' => 'ListingBlock',
'heading' => 'HeadingBlock',
'show_diagram' => 'ShowDiagramBlock',
'show_table' => 'ShowTableBlock',
'raw_api' => 'RawApiBlock',
'load_ref' => 'LoadRefBlock',
'entity_menu' => 'EntityMenuBlock',
)

Backend-related blocks.

All of these should inherit from BackendBlock class.