PHP Класс SqlParser\Components\CreateDefinition

Used for parsing CREATE TABLE statement.
Автор: Dan Ungureanu ([email protected])
Наследование: extends SqlParser\Component
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$FIELD_OPTIONS array All field options.
$isConstraint boolean Whether this field is a constraint or not.
$key Key The key.
$name string The name of the new column.
$options OptionsArray The options of this field.
$references Reference The table that is referenced.
$type DataType The data type of thew new column.

Открытые методы

Метод Описание
__construct ( string $name = null, OptionsArray $options = null, DataType | Key $type = null, boolean $isConstraint = false, Reference $references = null ) Constructor.
build ( CreateDefinition | CreateDefinition[] $component, array $options = [] ) : string
parse ( Parser $parser, TokensList $list, array $options = [] ) : CreateDefinition[]

Описание методов

__construct() публичный Метод

Constructor.
public __construct ( string $name = null, OptionsArray $options = null, DataType | Key $type = null, boolean $isConstraint = false, Reference $references = null )
$name string The name of the field.
$options OptionsArray The options of this field.
$type DataType | Key The data type of this field or the key.
$isConstraint boolean Whether this field is a constraint or not.
$references Reference References.

build() публичный статический Метод

public static build ( CreateDefinition | CreateDefinition[] $component, array $options = [] ) : string
$component CreateDefinition | CreateDefinition[] The component to be built.
$options array Parameters for building.
Результат string

parse() публичный статический Метод

public static parse ( Parser $parser, TokensList $list, array $options = [] ) : CreateDefinition[]
$parser SqlParser\Parser The parser that serves as context.
$list SqlParser\TokensList The list of tokens that are being parsed.
$options array Parameters for parsing.
Результат CreateDefinition[]

Описание свойств

$FIELD_OPTIONS публичное статическое свойство

All field options.
public static array $FIELD_OPTIONS
Результат array

$isConstraint публичное свойство

Whether this field is a constraint or not.
public bool $isConstraint
Результат boolean

$key публичное свойство

The key.
public Key,SqlParser\Components $key
Результат Key

$name публичное свойство

The name of the new column.
public string $name
Результат string

$options публичное свойство

The options of this field.
public OptionsArray,SqlParser\Components $options
Результат OptionsArray

$references публичное свойство

The table that is referenced.
public Reference,SqlParser\Components $references
Результат Reference

$type публичное свойство

The data type of thew new column.
public DataType,SqlParser\Components $type
Результат DataType