jDbSchema

package

jelix

Methods

__construct

__construct(\jDbConnection $conn) 

Arguments

create the given table into the database

_createTable(string $name, array $columns, string|array $primaryKey, array $attributes = array()) : \jDbTable
abstract

Arguments

$name

string

the table name

$columns

array

list of jDbColumn

$primaryKey

string|array

the name of the column which contains the primary key

$attributes

array

Response

\jDbTable

the object corresponding to the created table

_createTableQuery

_createTableQuery( $name,  $columns,  $primaryKey,  $attributes = array()) 

Arguments

$name

$columns

$primaryKey

$attributes

_dropTable

_dropTable( $name) 

Arguments

$name

_getTableInstance

_getTableInstance( $name) 
abstract

Arguments

$name

_getTables

_getTables() 
abstract

return the SQL string corresponding to the given column.

_prepareSqlColumn(\jDbColumn $col,  $isPrimaryKey = false,  $isSinglePrimaryKey = false) : string

private method, should be used only by a jDbTable object

access

private

Arguments

$col

\jDbColumn

the column

$isPrimaryKey

$isSinglePrimaryKey

Response

string

the sql string

_renameTable

_renameTable( $oldName,  $newName) 

Arguments

$oldName

$newName

create the given table if it does not exist

createTable(string $name, array<mixed,\jDbColumn> $columns, string|array<mixed,string> $primaryKey, array $attributes = array()) : \jDbTable

Arguments

$name

string

the unprefixed table name

$columns

array<mixed,\jDbColumn>

list of columns

$primaryKey

string|array<mixed,string>

the name of the column which contains the primary key

$attributes

array

some table attributes specific to the database

Response

\jDbTable

the object corresponding to the created table

dropTable

dropTable(string|\jDbTable $table) 

Arguments

$table

string|\jDbTable

the table object or the unprefixed table name

getConn

getConn() : \jDbConnection

Response

\jDbConnection

load informations of the given

getTable(string $name) : \jDbTable

Arguments

$name

string

the unprefixed table name

Response

\jDbTable

ready to make change

getTables

getTables() : array

Response

array

of jDbTable

fill correctly some properties of the column, depending of its type and other properties

normalizeColumn(\jDbColumn $col) 

Arguments

$col

\jDbColumn

renameTable

renameTable(string $oldName, string $newName) : \jDbTable|null

Arguments

$oldName

string

Unprefixed name of the table to rename

$newName

string

The new unprefixed name of the table

Response

\jDbTable|null

Properties

conn

conn : \jDbConnection
var

Type(s)

\jDbConnection

key of the array are unprefixed name of tables

tables : null|array<mixed,\jDbTable>
var

key of the array are unprefixed name of tables

Type(s)

null|array<mixed,\jDbTable>

supportAutoIncrement

supportAutoIncrement : 

Type(s)