PHP Class SqlParser\Components\CreateDefinition

Used for parsing CREATE TABLE statement.
Author: Dan Ungureanu ([email protected])
Inheritance: extends SqlParser\Component
Mostra file Open project: phpmyadmin/sql-parser Class Usage Examples

Public Properties

Property Type Description
$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.

Public Methods

Method Description
__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[]

Method Details

__construct() public method

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 method

public static build ( CreateDefinition | CreateDefinition[] $component, array $options = [] ) : string
$component CreateDefinition | CreateDefinition[] The component to be built.
$options array Parameters for building.
return string

parse() public static method

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.
return CreateDefinition[]

Property Details

$FIELD_OPTIONS public_oe static_oe property

All field options.
public static array $FIELD_OPTIONS
return array

$isConstraint public_oe property

Whether this field is a constraint or not.
public bool $isConstraint
return boolean

$key public_oe property

The key.
public Key,SqlParser\Components $key
return Key

$name public_oe property

The name of the new column.
public string $name
return string

$options public_oe property

The options of this field.
public OptionsArray,SqlParser\Components $options
return OptionsArray

$references public_oe property

The table that is referenced.
public Reference,SqlParser\Components $references
return Reference

$type public_oe property

The data type of thew new column.
public DataType,SqlParser\Components $type
return DataType