final class CreateDefinition extends Component (View source)

Parses the create definition of a column or a key.

Used for parsing CREATE TABLE statement.

Properties

static array<string,bool|int|array<int,int|string|array<string,bool>>> $FIELD_OPTIONS

All field options.

string|null $name

The name of the new column.

bool|null $isConstraint

Whether this field is a constraint or not.

DataType|null $type

The data type of thew new column.

Key|null $key

The key.

Reference|null $references

The table that is referenced.

OptionsArray|null $options

The options of this field.

Methods

static mixed
parse(Parser $parser, TokensList $list, array $options = [])

No description

static mixed
build(mixed $component, array $options = [])

No description

string
__toString()

Builds the string representation of a component of this type.

__construct(string|null $name = null, OptionsArray|null $options = null, DataType|Key|null $type = null, bool $isConstraint = false, Reference|null $references = null)

No description

Details

static mixed parse(Parser $parser, TokensList $list, array $options = [])

No description

Parameters

Parser $parser

the parser that serves as context

TokensList $list

the list of tokens that are being parsed

array $options

parameters for parsing

Return Value

mixed

static mixed build(mixed $component, array $options = [])

No description

Parameters

mixed $component

the component to be built

array $options

parameters for building

Return Value

mixed

string __toString()

Builds the string representation of a component of this type.

Return Value

string

See also

static::build

__construct(string|null $name = null, OptionsArray|null $options = null, DataType|Key|null $type = null, bool $isConstraint = false, Reference|null $references = null)

No description

Parameters

string|null $name

the name of the field

OptionsArray|null $options

the options of this field

DataType|Key|null $type

the data type of this field or the key

bool $isConstraint

whether this field is a constraint or not

Reference|null $references references