SqlGeneratorMySql
in package
implements
SqlGenerator
The SqlGeneratorMySql class
Use this class to generate entity's table SQL queries and check changes in structure
Table of Contents
Interfaces
- SqlGenerator
- The Sql interface
Methods
- getColumnDefinition() : string
- Get column definition
- getColumnInfosFromField() : array<string|int, mixed>
- Get column information from $field
- getCreate() : string
- Get create SQL query
- getDrop() : string
- getIncrementalChanges() : string|null
- Get changes with entity
- getIndexDefinition() : string
- Get index definition
- formatHTML_ColumnType() : string
- Format column type into HTML
- formatHTML_Command() : string
- Format command into HTML
- formatHTML_Identifier() : string
- Format identifier into HTML
- formatHTML_InlineBlock() : string
- Format inline block
- formatHTML_ReservedWord() : string
- Format reserved word into HTML
- formatHTML_SubCommand() : string
- Format subcommand into HTML
Methods
getColumnDefinition()
Get column definition
public
getColumnDefinition(array<string|int, mixed> $fieldColumn, AbstractSqlAdapter $sqlAdapter[, bool $withPK = true ]) : string
Parameters
- $fieldColumn : array<string|int, mixed>
- $sqlAdapter : AbstractSqlAdapter
- $withPK : bool = true
Return values
stringgetColumnInfosFromField()
Get column information from $field
public
getColumnInfosFromField(FieldDescriptor $field) : array<string|int, mixed>
Parameters
- $field : FieldDescriptor
Tags
Return values
array<string|int, mixed>getCreate()
Get create SQL query
public
getCreate(EntityDescriptor $ed, AbstractSqlAdapter $sqlAdapter) : string
Parameters
- $ed : EntityDescriptor
- $sqlAdapter : AbstractSqlAdapter
Tags
Return values
stringgetDrop()
public
getDrop(EntityDescriptor $ed, AbstractSqlAdapter $sqlAdapter) : string
Parameters
- $ed : EntityDescriptor
- $sqlAdapter : AbstractSqlAdapter
Return values
stringgetIncrementalChanges()
Get changes with entity
public
getIncrementalChanges(EntityDescriptor $ed, AbstractSqlAdapter $sqlAdapter) : string|null
Parameters
- $ed : EntityDescriptor
- $sqlAdapter : AbstractSqlAdapter
Tags
Return values
string|nullgetIndexDefinition()
Get index definition
public
getIndexDefinition(object $index, AbstractSqlAdapter $sqlAdapter) : string
Parameters
- $index : object
- $sqlAdapter : AbstractSqlAdapter
Return values
stringformatHTML_ColumnType()
Format column type into HTML
protected
formatHTML_ColumnType(string $string) : string
Parameters
- $string : string
Return values
stringformatHTML_Command()
Format command into HTML
protected
formatHTML_Command(string $string) : string
Parameters
- $string : string
Return values
stringformatHTML_Identifier()
Format identifier into HTML
protected
formatHTML_Identifier(string $identifier, AbstractSqlAdapter $sqlAdapter) : string
Parameters
- $identifier : string
- $sqlAdapter : AbstractSqlAdapter
Return values
stringformatHTML_InlineBlock()
Format inline block
protected
formatHTML_InlineBlock(string $string, string $class) : string
Parameters
- $string : string
- $class : string
Return values
stringformatHTML_ReservedWord()
Format reserved word into HTML
protected
formatHTML_ReservedWord(string $string[, string $class = '' ]) : string
Parameters
- $string : string
- $class : string = ''
Return values
stringformatHTML_SubCommand()
Format subcommand into HTML
protected
formatHTML_SubCommand(string $string) : string
Parameters
- $string : string