PHP Class Bolt\Storage\Database\Schema\Manager

Based on on parts of the monolithic Bolt\Database\IntegrityChecker class.
Author: Gawain Lynch ([email protected])
Inheritance: implements Bolt\Storage\Database\Schema\SchemaManagerInterface
Datei anzeigen Open project: bolt/bolt Class Usage Examples

Protected Properties

Property Type Description
$config Bolt\Config
$connection Doctrine\DBAL\Connection
$installedTables Doctrine\DBAL\Schema\Table[]
$schema Doctrine\DBAL\Schema\Schema
$schemaTables Doctrine\DBAL\Schema\Table[]

Public Methods

Method Description
__construct ( Silex\Application $app ) Constructor.
check ( ) : SchemaCheck Run a check against current and configured schemas.
getInstalledTables ( ) : Doctrine\DBAL\Schema\Table[] Get the installed table list from Doctrine.
getSchema ( ) : Doctrine\DBAL\Schema\Schema Get the built schema.
getSchemaTables ( ) : Doctrine\DBAL\Schema\Table[] Get a merged array of tables.
getTableName ( string $name ) : string | null Get the database name of a table from an alias.
hasUserTable ( ) : boolean Check if just the users table is present.
isCheckRequired ( )
isUpdateRequired ( )
registerExtensionTable ( callable $generator ) This method allows extensions to register their own tables.
update ( ) : SchemaCheck Run database table updates.

Private Methods

Method Description
getSchemaComparator ( ) : Bolt\Storage\Database\Schema\Comparison\BaseComparator
getSchemaTimer ( ) : Timer

Method Details

__construct() public method

Constructor.
public __construct ( Silex\Application $app )
$app Silex\Application

check() public method

Run a check against current and configured schemas.
public check ( ) : SchemaCheck
return SchemaCheck

getInstalledTables() public method

Get the installed table list from Doctrine.
public getInstalledTables ( ) : Doctrine\DBAL\Schema\Table[]
return Doctrine\DBAL\Schema\Table[]

getSchema() public method

Get the built schema.
public getSchema ( ) : Doctrine\DBAL\Schema\Schema
return Doctrine\DBAL\Schema\Schema

getSchemaTables() public method

Get a merged array of tables.
public getSchemaTables ( ) : Doctrine\DBAL\Schema\Table[]
return Doctrine\DBAL\Schema\Table[]

getTableName() public method

Get the database name of a table from an alias.
public getTableName ( string $name ) : string | null
$name string
return string | null

hasUserTable() public method

Check if just the users table is present.
public hasUserTable ( ) : boolean
return boolean

isCheckRequired() public method

public isCheckRequired ( )

isUpdateRequired() public method

public isUpdateRequired ( )

registerExtensionTable() public method

This method allows extensions to register their own tables.
public registerExtensionTable ( callable $generator )
$generator callable A generator function that takes the Schema instance and returns a table or an array of tables.

update() public method

Run database table updates.
public update ( ) : SchemaCheck
return SchemaCheck

Property Details

$config protected_oe property

protected Config,Bolt $config
return Bolt\Config

$connection protected_oe property

protected Connection,Doctrine\DBAL $connection
return Doctrine\DBAL\Connection

$installedTables protected_oe property

protected Table[],Doctrine\DBAL\Schema $installedTables
return Doctrine\DBAL\Schema\Table[]

$schema protected_oe property

protected Schema,Doctrine\DBAL\Schema $schema
return Doctrine\DBAL\Schema\Schema

$schemaTables protected_oe property

protected Table[],Doctrine\DBAL\Schema $schemaTables
return Doctrine\DBAL\Schema\Table[]