Blueprint
in package
Класс для создания SQL-запросов определения таблиц
Table of Contents
Properties
- $charset : string|null
- $collation : string|null
- $columns : array<string|int, mixed>
- $dialect : DatabaseDialectInterface
- $engine : string|null
- $table : string
- $tableComment : string|null
- $tableOptions : array<string|int, mixed>
Methods
- __construct() : mixed
- Конструктор.
- after() : self
- autoIncrement() : self
- bigInteger() : self
- binary() : self
- blob() : self
- boolean() : self
- char() : self
- comment() : self
- compileCreate() : string
- Генерирует SQL-запрос для создания таблицы.
- date() : self
- dateTime() : self
- decimal() : self
- default() : self
- double() : self
- enum() : self
- first() : self
- float() : self
- geometry() : self
- geometryCollection() : self
- id() : void
- Добавляет первичный ключ (id) в таблицу.
- index() : self
- integer() : self
- json() : self
- lineString() : self
- longBlob() : self
- longText() : self
- mediumBlob() : self
- mediumInteger() : self
- mediumText() : self
- multiLineString() : self
- multiPoint() : self
- multiPolygon() : self
- nullable() : self
- point() : self
- polygon() : self
- primary() : self
- rememberToken() : void
- set() : self
- smallInteger() : self
- softDeletes() : void
- string() : self
- text() : self
- time() : self
- timestamp() : self
- timestamps() : void
- tinyInteger() : self
- unique() : self
- unsigned() : self
- unsignedInteger() : self
- year() : self
Properties
$charset
private
string|null
$charset
= null
$collation
private
string|null
$collation
= null
$columns
private
array<string|int, mixed>
$columns
= []
$dialect
private
DatabaseDialectInterface
$dialect
$engine
private
string|null
$engine
= null
$table
private
string
$table
$tableComment
private
string|null
$tableComment
= null
$tableOptions
private
array<string|int, mixed>
$tableOptions
= []
Methods
__construct()
Конструктор.
public
__construct(string $table, DatabaseDialectInterface $dialect) : mixed
Parameters
- $table : string
-
Название таблицы
- $dialect : DatabaseDialectInterface
after()
public
after(string $column) : self
Parameters
- $column : string
Return values
selfautoIncrement()
public
autoIncrement() : self
Return values
selfbigInteger()
public
bigInteger(string $column[, int|null $length = null ]) : self
Parameters
- $column : string
- $length : int|null = null
Return values
selfbinary()
public
binary(string $column[, int $length = 255 ]) : self
Parameters
- $column : string
- $length : int = 255
Return values
selfblob()
public
blob(string $column) : self
Parameters
- $column : string
Return values
selfboolean()
public
boolean(string $column) : self
Parameters
- $column : string
Return values
selfchar()
public
char(string $column[, int $length = 255 ]) : self
Parameters
- $column : string
- $length : int = 255
Return values
selfcomment()
public
comment(string $comment) : self
Parameters
- $comment : string
Return values
selfcompileCreate()
Генерирует SQL-запрос для создания таблицы.
public
compileCreate() : string
Return values
string —SQL-запрос CREATE TABLE
date()
public
date(string $column) : self
Parameters
- $column : string
Return values
selfdateTime()
public
dateTime(string $column[, int|null $precision = null ]) : self
Parameters
- $column : string
- $precision : int|null = null
Return values
selfdecimal()
public
decimal(string $column[, int $precision = 10 ][, int $scale = 2 ]) : self
Parameters
- $column : string
- $precision : int = 10
- $scale : int = 2
Return values
selfdefault()
public
default(mixed $value) : self
Parameters
- $value : mixed
Return values
selfdouble()
public
double(string $column[, int|null $precision = null ][, int|null $scale = null ]) : self
Parameters
- $column : string
- $precision : int|null = null
- $scale : int|null = null
Return values
selfenum()
public
enum(string $column, array<string|int, mixed> $values) : self
Parameters
- $column : string
- $values : array<string|int, mixed>
Return values
selffirst()
public
first() : self
Return values
selffloat()
public
float(string $column[, int|null $precision = null ][, int|null $scale = null ]) : self
Parameters
- $column : string
- $precision : int|null = null
- $scale : int|null = null
Return values
selfgeometry()
public
geometry(string $column) : self
Parameters
- $column : string
Return values
selfgeometryCollection()
public
geometryCollection(string $column) : self
Parameters
- $column : string
Return values
selfid()
Добавляет первичный ключ (id) в таблицу.
public
id() : void
index()
public
index() : self
Return values
selfinteger()
public
integer(string $column[, int|null $length = null ]) : self
Parameters
- $column : string
- $length : int|null = null
Return values
selfjson()
public
json(string $column) : self
Parameters
- $column : string
Return values
selflineString()
public
lineString(string $column) : self
Parameters
- $column : string
Return values
selflongBlob()
public
longBlob(string $column) : self
Parameters
- $column : string
Return values
selflongText()
public
longText(string $column) : self
Parameters
- $column : string
Return values
selfmediumBlob()
public
mediumBlob(string $column) : self
Parameters
- $column : string
Return values
selfmediumInteger()
public
mediumInteger(string $column[, int|null $length = null ]) : self
Parameters
- $column : string
- $length : int|null = null
Return values
selfmediumText()
public
mediumText(string $column) : self
Parameters
- $column : string
Return values
selfmultiLineString()
public
multiLineString(string $column) : self
Parameters
- $column : string
Return values
selfmultiPoint()
public
multiPoint(string $column) : self
Parameters
- $column : string
Return values
selfmultiPolygon()
public
multiPolygon(string $column) : self
Parameters
- $column : string
Return values
selfnullable()
public
nullable() : self
Return values
selfpoint()
public
point(string $column) : self
Parameters
- $column : string
Return values
selfpolygon()
public
polygon(string $column) : self
Parameters
- $column : string
Return values
selfprimary()
public
primary() : self
Return values
selfrememberToken()
public
rememberToken() : void
set()
public
set(string $column, array<string|int, mixed> $values) : self
Parameters
- $column : string
- $values : array<string|int, mixed>
Return values
selfsmallInteger()
public
smallInteger(string $column[, int|null $length = null ]) : self
Parameters
- $column : string
- $length : int|null = null
Return values
selfsoftDeletes()
public
softDeletes() : void
string()
public
string(string $column[, int $length = 255 ]) : self
Parameters
- $column : string
- $length : int = 255
Return values
selftext()
public
text(string $column) : self
Parameters
- $column : string
Return values
selftime()
public
time(string $column[, int|null $precision = null ]) : self
Parameters
- $column : string
- $precision : int|null = null
Return values
selftimestamp()
public
timestamp(string $column[, int|null $precision = null ]) : self
Parameters
- $column : string
- $precision : int|null = null
Return values
selftimestamps()
public
timestamps() : void
tinyInteger()
public
tinyInteger(string $column[, int|null $length = null ]) : self
Parameters
- $column : string
- $length : int|null = null
Return values
selfunique()
public
unique() : self
Return values
selfunsigned()
public
unsigned() : self
Return values
selfunsignedInteger()
public
unsignedInteger(string $column[, int|null $length = null ]) : self
Parameters
- $column : string
- $length : int|null = null
Return values
selfyear()
public
year(string $column) : self
Parameters
- $column : string