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
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.