PHP Class Storm\Core\Relational\Database

The databse represents a group of tables, their columns and relations.
Author: Elliot Levin ([email protected])
Inheritance: use trait Storm\Core\Helpers\Type
Datei anzeigen Open project: timetoogo/penumbra Class Usage Examples

Public Methods

Method Description
Commit ( Transaction $Transaction ) : void Commits the supplied transaction.
GetTable ( string $Name ) : Storm\Core\Relational\ITable | null Gets a table by name.
GetTables ( ) : Storm\Core\Relational\ITable[]
GetTablesOrderedByDiscardingDependency ( ) : Storm\Core\Relational\ITable[]
GetTablesOrderedByPersistingDependency ( ) : Storm\Core\Relational\ITable[]
HasTable ( string $Name ) : boolean Whether or not a table has been registered.
Load ( Request $Request ) : ResultRow[] Load the rows specified by the request.
__construct ( )

Protected Methods

Method Description
CommitTransaction ( Transaction $Transaction ) : void This method should be implemented such that it commits the supplied transaction to the underlying database.
LoadResultRowData ( Request $Request ) : array[] This method should be implemented such that is returns the rows specified by the request from the underlying database.
RegisterTables ( Registrar $Registrar ) : void The method to specify the tables in the current database.

Private Methods

Method Description
AddTableToOrderedTables ( Storm\Core\Relational\ITable $Table, array &$OrderedTables, integer $DependencyMode ) : void Adds a table to an array in a specified dependency order.
AddTables ( array $Tables ) Adds an array of tables.
VerifyTable ( $Method, Storm\Core\Relational\ITable $Table ) Verifies a table is registered in this database.

Method Details

Commit() final public method

Commits the supplied transaction.
final public Commit ( Transaction $Transaction ) : void
$Transaction Transaction The transaction to commit
return void

CommitTransaction() abstract protected method

This method should be implemented such that it commits the supplied transaction to the underlying database.
abstract protected CommitTransaction ( Transaction $Transaction ) : void
$Transaction Transaction The transaction to commit
return void

GetTable() final public method

Gets a table by name.
final public GetTable ( string $Name ) : Storm\Core\Relational\ITable | null
$Name string The name of the table
return Storm\Core\Relational\ITable | null The matching table or null if it has not been registered

GetTables() final public method

final public GetTables ( ) : Storm\Core\Relational\ITable[]
return Storm\Core\Relational\ITable[]

GetTablesOrderedByDiscardingDependency() public method

public GetTablesOrderedByDiscardingDependency ( ) : Storm\Core\Relational\ITable[]
return Storm\Core\Relational\ITable[]

GetTablesOrderedByPersistingDependency() public method

public GetTablesOrderedByPersistingDependency ( ) : Storm\Core\Relational\ITable[]
return Storm\Core\Relational\ITable[]

HasTable() final public method

Whether or not a table has been registered.
final public HasTable ( string $Name ) : boolean
$Name string The name of the table
return boolean

Load() final public method

Load the rows specified by the request.
final public Load ( Request $Request ) : ResultRow[]
$Request Request The request to load
return ResultRow[] The loaded result rows

LoadResultRowData() abstract protected method

This method should be implemented such that is returns the rows specified by the request from the underlying database.
abstract protected LoadResultRowData ( Request $Request ) : array[]
$Request Request The request to load
return array[] The loaded result rows data as an associative array indexed by column identifiers

RegisterTables() abstract protected method

The method to specify the tables in the current database.
abstract protected RegisterTables ( Registrar $Registrar ) : void
$Registrar Storm\Core\Containers\Registrar The registrar to register the tables
return void

__construct() public method

public __construct ( )