PHP Class SqlParser\Components\Key

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

Public Properties

Property Type Description
$KEY_OPTIONS array All key options.
$columns array Columns.
$name string The name of this key.
$options OptionsArray The options of this key.
$type string The type of this key.

Public Methods

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

Method Details

__construct() public method

Constructor.
public __construct ( string $name = null, array $columns = [], string $type = null, OptionsArray $options = null )
$name string The name of the key.
$columns array The columns covered by this key.
$type string The type of this key.
$options OptionsArray The options of this key.

build() public static method

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

Property Details

$KEY_OPTIONS public static property

All key options.
public static array $KEY_OPTIONS
return array

$columns public property

Columns.
public array $columns
return array

$name public property

The name of this key.
public string $name
return string

$options public property

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

$type public property

The type of this key.
public string $type
return string