PHP Class SqlParser\Components\Expression

Author: Dan Ungureanu ([email protected])
Inheritance: extends SqlParser\Component
Datei anzeigen Open project: phpmyadmin/sql-parser Class Usage Examples

Public Properties

Property Type Description
$alias string The alias of this expression.
$column string The name of the column.
$database string The name of this database.
$expr string The sub-expression.
$function mixed The name of the function.
$subquery string The type of subquery.
$table string The name of this table.

Public Methods

Method Description
__construct ( string $database = null, string $table = null, string $column = null, string $alias = null ) Constructor.
build ( Expression | Expression[] $component, array $options = [] ) : string
parse ( Parser $parser, TokensList $list, array $options = [] ) : Expression Possible options:

Method Details

__construct() public method

Syntax: new Expression('expr') new Expression('expr', 'alias') new Expression('database', 'table', 'column') new Expression('database', 'table', 'column', 'alias') If the database, table or column name is not required, pass an empty string.
public __construct ( string $database = null, string $table = null, string $column = null, string $alias = null )
$database string The name of the database or the the expression. the the expression.
$table string The name of the table or the alias of the expression. the alias of the expression.
$column string The name of the column.
$alias string The name of the alias.

build() public static method

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

parse() public static method

field First field to be filled. If this is not specified, it takes the value of parseField. parseField Specifies the type of the field parsed. It may be database, table or column. These expressions may not include parentheses. breakOnAlias If not empty, breaks when the alias occurs (it is not included). breakOnParentheses If not empty, breaks when the first parentheses occurs. parenthesesDelimited If not empty, breaks after last parentheses occurred.
public static parse ( Parser $parser, TokensList $list, array $options = [] ) : Expression
$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 Expression

Property Details

$alias public_oe property

The alias of this expression.
public string $alias
return string

$column public_oe property

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

$database public_oe property

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

$expr public_oe property

The sub-expression.
public string $expr
return string

$function public_oe property

The name of the function.
public mixed $function
return mixed

$subquery public_oe property

The type of subquery.
public string $subquery
return string

$table public_oe property

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