PHP Class Pagekit\Database\Utility

Show file Open project: pagekit/pagekit

Protected Properties

Property Type Description
$connection Pagekit\Database\Connection
$manager Doctrine\DBAL\Schema\AbstractSchemaManager
$schema Doctrine\DBAL\Schema\Schema

Public Methods

Method Description
__call ( string $method, array $args ) : mixed Proxy method call to database schema manager.
__construct ( Pagekit\Database\Connection $connection ) Constructor.
createConstraint ( Doctrine\DBAL\Schema\Constraint $constraint, $table ) {@see AbstractSchemaManager::createConstraint}
createForeignKey ( Doctrine\DBAL\Schema\ForeignKeyConstraint $foreignKey, $table ) {@see AbstractSchemaManager::createForeignKey}
createIndex ( Doctrine\DBAL\Schema\Index $index, $table ) {@see AbstractSchemaManager::createIndex}
createTable ( string $table, Closure $callback ) Creates a new database table.
dropAndCreateConstraint ( Doctrine\DBAL\Schema\Constraint $constraint, $table ) {@see AbstractSchemaManager::dropAndCreateConstraint}
dropAndCreateForeignKey ( Doctrine\DBAL\Schema\ForeignKeyConstraint $foreignKey, $table ) {@see AbstractSchemaManager::dropAndCreateForeignKey}
dropAndCreateIndex ( Doctrine\DBAL\Schema\Index $index, $table ) {@see AbstractSchemaManager::dropAndCreateIndex}
dropAndCreateTable ( $table ) {@see AbstractSchemaManager::dropAndCreateTable}
dropConstraint ( Doctrine\DBAL\Schema\Constraint $constraint, $table ) {@see AbstractSchemaManager::dropConstraint}
dropForeignKey ( $foreignKey, $table ) {@see AbstractSchemaManager::dropForeignKey}
dropIndex ( $index, $table ) {@see AbstractSchemaManager::dropIndex}
dropTable ( $table )
getSchemaManager ( ) : Doctrine\DBAL\Schema\AbstractSchemaManager Return the DBAL schema manager.
getTable ( string $table ) : Table Returns an existing database table.
listTableColumns ( $table, $database = null ) {@see AbstractSchemaManager::listTableColumns}
listTableDetails ( $tableName ) {@see AbstractSchemaManager::listTableDetails}
listTableForeignKeys ( $table, $database = null ) {@see AbstractSchemaManager::listTableForeignKeys}
listTableIndexes ( $table ) {@see AbstractSchemaManager::listTableIndexes}
migrate ( ) : Doctrine\DBAL\Schema\Schema Migrates the database.
renameTable ( $name, $newName ) {@see AbstractSchemaManager::renameTable}
tableExists ( string $table ) : boolean Returns true if the given table exists.
tablesExist ( array $tables ) : boolean Returns true if all the given tables exist.

Protected Methods

Method Description
replacePrefix ( string $query ) : string Replaces the table prefix placeholder with actual one.

Method Details

__call() public method

Proxy method call to database schema manager.
public __call ( string $method, array $args ) : mixed
$method string
$args array
return mixed

__construct() public method

Constructor.
public __construct ( Pagekit\Database\Connection $connection )
$connection Pagekit\Database\Connection

createConstraint() public method

{@see AbstractSchemaManager::createConstraint}
public createConstraint ( Doctrine\DBAL\Schema\Constraint $constraint, $table )
$constraint Doctrine\DBAL\Schema\Constraint

createForeignKey() public method

{@see AbstractSchemaManager::createForeignKey}
public createForeignKey ( Doctrine\DBAL\Schema\ForeignKeyConstraint $foreignKey, $table )
$foreignKey Doctrine\DBAL\Schema\ForeignKeyConstraint

createIndex() public method

{@see AbstractSchemaManager::createIndex}
public createIndex ( Doctrine\DBAL\Schema\Index $index, $table )
$index Doctrine\DBAL\Schema\Index

createTable() public method

Creates a new database table.
public createTable ( string $table, Closure $callback )
$table string
$callback Closure

dropAndCreateConstraint() public method

{@see AbstractSchemaManager::dropAndCreateConstraint}
public dropAndCreateConstraint ( Doctrine\DBAL\Schema\Constraint $constraint, $table )
$constraint Doctrine\DBAL\Schema\Constraint

dropAndCreateForeignKey() public method

{@see AbstractSchemaManager::dropAndCreateForeignKey}
public dropAndCreateForeignKey ( Doctrine\DBAL\Schema\ForeignKeyConstraint $foreignKey, $table )
$foreignKey Doctrine\DBAL\Schema\ForeignKeyConstraint

dropAndCreateIndex() public method

{@see AbstractSchemaManager::dropAndCreateIndex}
public dropAndCreateIndex ( Doctrine\DBAL\Schema\Index $index, $table )
$index Doctrine\DBAL\Schema\Index

dropAndCreateTable() public method

{@see AbstractSchemaManager::dropAndCreateTable}
public dropAndCreateTable ( $table )

dropConstraint() public method

{@see AbstractSchemaManager::dropConstraint}
public dropConstraint ( Doctrine\DBAL\Schema\Constraint $constraint, $table )
$constraint Doctrine\DBAL\Schema\Constraint

dropForeignKey() public method

{@see AbstractSchemaManager::dropForeignKey}
public dropForeignKey ( $foreignKey, $table )

dropIndex() public method

{@see AbstractSchemaManager::dropIndex}
public dropIndex ( $index, $table )

dropTable() public method

See also: AbstractSchemaManager::dropTable
public dropTable ( $table )

getSchemaManager() public method

Return the DBAL schema manager.
public getSchemaManager ( ) : Doctrine\DBAL\Schema\AbstractSchemaManager
return Doctrine\DBAL\Schema\AbstractSchemaManager

getTable() public method

Returns an existing database table.
public getTable ( string $table ) : Table
$table string
return Table

listTableColumns() public method

{@see AbstractSchemaManager::listTableColumns}
public listTableColumns ( $table, $database = null )

listTableDetails() public method

{@see AbstractSchemaManager::listTableDetails}
public listTableDetails ( $tableName )

listTableForeignKeys() public method

{@see AbstractSchemaManager::listTableForeignKeys}
public listTableForeignKeys ( $table, $database = null )

listTableIndexes() public method

{@see AbstractSchemaManager::listTableIndexes}
public listTableIndexes ( $table )

migrate() public method

Migrates the database.
public migrate ( ) : Doctrine\DBAL\Schema\Schema
return Doctrine\DBAL\Schema\Schema

renameTable() public method

{@see AbstractSchemaManager::renameTable}
public renameTable ( $name, $newName )

replacePrefix() protected method

Replaces the table prefix placeholder with actual one.
protected replacePrefix ( string $query ) : string
$query string
return string

tableExists() public method

Returns true if the given table exists.
public tableExists ( string $table ) : boolean
$table string
return boolean

tablesExist() public method

Returns true if all the given tables exist.
public tablesExist ( array $tables ) : boolean
$tables array
return boolean

Property Details

$connection protected property

protected Connection,Pagekit\Database $connection
return Pagekit\Database\Connection

$manager protected property

protected AbstractSchemaManager,Doctrine\DBAL\Schema $manager
return Doctrine\DBAL\Schema\AbstractSchemaManager

$schema protected property

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