API Documentation (v0.9.0-alpha)

Avolutions\Database\Column

The Column class represents the schema of a database table column.

Constants

Property Value Description
CURRENT_TIMESTAMP 'CURRENT_TIMESTAMP' A constant for the string "CURRENT_TIMESTAMP"
NOT_NULL 'NOT NULL' A constant for the string "NOT NULL"
NULL 'NULL' A constant for the string "NULL"

Methods

Method Visibility Description
__construct() public Creates a new Column object.
getPattern() public Returns the SQL pattern for the column.

Constant Details

CURRENT_TIMESTAMP

A constant for the string "CURRENT_TIMESTAMP"

const CURRENT_TIMESTAMP = 'CURRENT_TIMESTAMP'
NOT_NULL

A constant for the string "NOT NULL"

const NOT_NULL = 'NOT NULL'
NULL

A constant for the string "NULL"

const NULL = 'NULL'

Method Details

__construct()

Creates a new Column object.

public __construct(string $name, string $type[, string|null $length = null ][, string|null $default = null ][, string $null = Column::NOT_NULL ][, bool $primaryKey = false ][, bool $autoIncrement = false ]) : mixed
Parameters

string $name
The name of the column.

string $type
The data type of the column.

string|null $length (optional)
The length of the column.

string|null $default (optional)
The default value of the column.

string $null (optional)
A flag if the column can be null or not.

bool $primaryKey (optional)
A flag if the column is a primary key or not.

bool $autoIncrement (optional)
A flag if the column is an auto increment column or not.

getPattern()

Returns the SQL pattern for the column.

public getPattern() : string
Return values
string Returns the SQL pattern for the column.