Aplus Framework Docs

TableDefinition extends DefinitionPart
in package

Class TableDefinition.

Table of Contents

$checks  : array<string|int, mixed>
$columns  : array<string|int, mixed>
$condition  : string|null
$database  : Database
$indexes  : array<string|int, mixed>
__call()  : mixed
__construct()  : mixed
TableDefinition constructor.
check()  : Check
Adds a check constraint to the Table Definition list.
column()  : ColumnDefinition
Adds a column to the Table Definition list.
index()  : IndexDefinition
Adds an index to the Table Definition list.
renderChecks()  : string
renderColumns()  : string
renderIndexes()  : string
sql()  : string

Properties

Methods

__call()

public __call(string $method, array<int, mixed> $arguments) : mixed
Parameters
$method : string
$arguments : array<int, mixed>
Return values
mixed

__construct()

TableDefinition constructor.

public __construct(Database $database[, string|null $condition = null ]) : mixed
Parameters
$database : Database
$condition : string|null = null
Return values
mixed

check()

Adds a check constraint to the Table Definition list.

public check(Closure $expression) : Check
Parameters
$expression : Closure

Must return a string with the check expression. The function receives a Database instance in the first parameter.

Return values
Check

column()

Adds a column to the Table Definition list.

public column(string $name[, string|null $changeName = null ]) : ColumnDefinition
Parameters
$name : string

Column name

$changeName : string|null = null

New column name. Used on ALTER TABLE CHANGE

Return values
ColumnDefinition

renderChecks()

protected renderChecks() : string
Return values
string

renderColumns()

protected renderColumns([string|null $prefix = null ]) : string
Parameters
$prefix : string|null = null
Return values
string

renderIndexes()

protected renderIndexes([string|null $prefix = null ]) : string
Parameters
$prefix : string|null = null
Return values
string

sql()

protected sql([string|null $prefix = null ]) : string
Parameters
$prefix : string|null = null
Return values
string

Search results