PHP Class SqlParser\Components\DataType

Inheritance: extends SqlParser\Component
Mostrar archivo Open project: phpmyadmin/sql-parser Class Usage Examples

Public Properties

Property Type Description
$DATA_TYPE_OPTIONS array All data type options.
$name string The name of the data type.
$options OptionsArray The options of this data type.
$parameters array Some data types have no parameters. Numeric types might have parameters for the maximum number of digits, precision, etc. String types might have parameters for the maximum length stored. ENUM and SET have parameters for possible values. For more information, check the MySQL manual.

Public Methods

Method Description
__construct ( string $name = null, array $parameters = [], OptionsArray $options = null ) Constructor.
build ( DataType $component, array $options = [] ) : string
parse ( Parser $parser, TokensList $list, array $options = [] ) : DataType

Method Details

__construct() public method

Constructor.
public __construct ( string $name = null, array $parameters = [], OptionsArray $options = null )
$name string The name of this data type.
$parameters array The parameters (size or possible values).
$options OptionsArray The options of this data type.

build() public static method

public static build ( DataType $component, array $options = [] ) : string
$component DataType 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 = [] ) : DataType
$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 DataType

Property Details

$DATA_TYPE_OPTIONS public_oe static_oe property

All data type options.
public static array $DATA_TYPE_OPTIONS
return array

$name public_oe property

The name of the data type.
public string $name
return string

$options public_oe property

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

$parameters public_oe property

Some data types have no parameters. Numeric types might have parameters for the maximum number of digits, precision, etc. String types might have parameters for the maximum length stored. ENUM and SET have parameters for possible values. For more information, check the MySQL manual.
public array $parameters
return array