Grammar
extends Grammar
in package
Table of Contents
- $tablePrefix : string
- The grammar table prefix.
- $transactions : bool
- If this Grammar supports schema changes wrapped in a transaction.
- columnize() : string
- Convert an array of column names into a delimited string.
- compileChange() : array<string|int, mixed>
- Compile a change column command into a series of SQL statements.
- compileForeign() : string
- Compile a foreign key command.
- compileRenameColumn() : array<string|int, mixed>
- Compile a rename column command.
- getDateFormat() : string
- Get the format for database stored dates.
- getDoctrineTableDiff() : TableDiff
- Create an empty Doctrine DBAL TableDiff from the Blueprint.
- getTablePrefix() : string
- Get the grammar's table prefix.
- getValue() : string
- Get the value of a raw expression.
- isExpression() : bool
- Determine if the given value is a raw expression.
- parameter() : string
- Get the appropriate query parameter place-holder for a value.
- parameterize() : string
- Create query parameter place-holders for an array.
- prefixArray() : array<string|int, mixed>
- Add a prefix to an array of values.
- setTablePrefix() : $this
- Set the grammar's table prefix.
- supportsSchemaTransactions() : bool
- Check if this Grammar supports schema changes wrapped in a transaction.
- wrap() : string
- Wrap a value in keyword identifiers.
- wrapArray() : array<string|int, mixed>
- Wrap an array of values.
- wrapTable() : string
- Wrap a table in keyword identifiers.
- addModifiers() : string
- Add the column modifiers to the definition.
- getColumns() : array<string|int, mixed>
- Compile the blueprint's column definitions.
- getCommandByName() : Fluent|null
- Get the primary key command if it exists on the blueprint.
- getCommandsByName() : array<string|int, mixed>
- Get all of the commands with a given name.
- getDefaultValue() : string
- Format a value so that it can be used in "default" clauses.
- getType() : string
- Get the SQL for the column data type.
- wrapAliasedValue() : string
- Wrap a value that has an alias.
- wrapSegments() : string
- Wrap the given value segments.
- wrapValue() : string
- Wrap a single string in keyword identifiers.
Properties
$tablePrefix
The grammar table prefix.
protected
string
$tablePrefix
= ''
$transactions
If this Grammar supports schema changes wrapped in a transaction.
protected
bool
$transactions
= false
Methods
columnize()
Convert an array of column names into a delimited string.
public
columnize(array<string|int, mixed> $columns) : string
Parameters
- $columns : array<string|int, mixed>
Return values
string —compileChange()
Compile a change column command into a series of SQL statements.
public
compileChange(Blueprint $blueprint, Fluent $command, Connection $connection) : array<string|int, mixed>
Parameters
- $blueprint : Blueprint
- $command : Fluent
- $connection : Connection
Tags
Return values
array<string|int, mixed> —compileForeign()
Compile a foreign key command.
public
compileForeign(Blueprint $blueprint, Fluent $command) : string
Parameters
Return values
string —compileRenameColumn()
Compile a rename column command.
public
compileRenameColumn(Blueprint $blueprint, Fluent $command, Connection $connection) : array<string|int, mixed>
Parameters
- $blueprint : Blueprint
- $command : Fluent
- $connection : Connection
Return values
array<string|int, mixed> —getDateFormat()
Get the format for database stored dates.
public
getDateFormat() : string
Return values
string —getDoctrineTableDiff()
Create an empty Doctrine DBAL TableDiff from the Blueprint.
public
getDoctrineTableDiff(Blueprint $blueprint, AbstractSchemaManager $schema) : TableDiff
Parameters
- $blueprint : Blueprint
- $schema : AbstractSchemaManager
Return values
TableDiff —getTablePrefix()
Get the grammar's table prefix.
public
getTablePrefix() : string
Return values
string —getValue()
Get the value of a raw expression.
public
getValue(Expression $expression) : string
Parameters
- $expression : Expression
Return values
string —isExpression()
Determine if the given value is a raw expression.
public
isExpression(mixed $value) : bool
Parameters
- $value : mixed
Return values
bool —parameter()
Get the appropriate query parameter place-holder for a value.
public
parameter(mixed $value) : string
Parameters
- $value : mixed
Return values
string —parameterize()
Create query parameter place-holders for an array.
public
parameterize(array<string|int, mixed> $values) : string
Parameters
- $values : array<string|int, mixed>
Return values
string —prefixArray()
Add a prefix to an array of values.
public
prefixArray(string $prefix, array<string|int, mixed> $values) : array<string|int, mixed>
Parameters
- $prefix : string
- $values : array<string|int, mixed>
Return values
array<string|int, mixed> —setTablePrefix()
Set the grammar's table prefix.
public
setTablePrefix(string $prefix) : $this
Parameters
- $prefix : string
Return values
$this —supportsSchemaTransactions()
Check if this Grammar supports schema changes wrapped in a transaction.
public
supportsSchemaTransactions() : bool
Return values
bool —wrap()
Wrap a value in keyword identifiers.
public
wrap(Expression|string $value[, bool $prefixAlias = false ]) : string
Parameters
- $value : Expression|string
- $prefixAlias : bool = false
Return values
string —wrapArray()
Wrap an array of values.
public
wrapArray(array<string|int, mixed> $values) : array<string|int, mixed>
Parameters
- $values : array<string|int, mixed>
Return values
array<string|int, mixed> —wrapTable()
Wrap a table in keyword identifiers.
public
wrapTable(mixed $table) : string
Parameters
- $table : mixed
Return values
string —addModifiers()
Add the column modifiers to the definition.
protected
addModifiers(string $sql, Blueprint $blueprint, Fluent $column) : string
Parameters
Return values
string —getColumns()
Compile the blueprint's column definitions.
protected
getColumns(Blueprint $blueprint) : array<string|int, mixed>
Parameters
- $blueprint : Blueprint
Return values
array<string|int, mixed> —getCommandByName()
Get the primary key command if it exists on the blueprint.
protected
getCommandByName(Blueprint $blueprint, string $name) : Fluent|null
Parameters
- $blueprint : Blueprint
- $name : string
Return values
Fluent|null —getCommandsByName()
Get all of the commands with a given name.
protected
getCommandsByName(Blueprint $blueprint, string $name) : array<string|int, mixed>
Parameters
- $blueprint : Blueprint
- $name : string
Return values
array<string|int, mixed> —getDefaultValue()
Format a value so that it can be used in "default" clauses.
protected
getDefaultValue(mixed $value) : string
Parameters
- $value : mixed
Return values
string —getType()
Get the SQL for the column data type.
protected
getType(Fluent $column) : string
Parameters
- $column : Fluent
Return values
string —wrapAliasedValue()
Wrap a value that has an alias.
protected
wrapAliasedValue(string $value[, bool $prefixAlias = false ]) : string
Parameters
- $value : string
- $prefixAlias : bool = false
Return values
string —wrapSegments()
Wrap the given value segments.
protected
wrapSegments(array<string|int, mixed> $segments) : string
Parameters
- $segments : array<string|int, mixed>
Return values
string —wrapValue()
Wrap a single string in keyword identifiers.
protected
wrapValue(string $value) : string
Parameters
- $value : string