PHP Class SqlParser\Statement

Author: Dan Ungureanu ([email protected])
Afficher le fichier Open project: phpmyadmin/sql-parser Class Usage Examples

Méthodes publiques

Свойство Type Description
$CLAUSES array The value attributed to each clause is used by the builder and it may have one of the following values: - 1 = 01 - add the clause only - 2 = 10 - add the keyword - 3 = 11 - add both the keyword and the clause
$OPTIONS array The option would be the key and the value can be an integer or an array. The integer represents only the index used. The array may have two keys: 0 is used to represent the index used and 1 is the type of the option (which may be 'var' or 'var='). Both options mean they expect a value after the option (e.g. A = B or A B, in which case A is the key and B is the value). The only difference is in the building process. var options are built as A B and var= options are built as A = B Two options that can be used together must have different values for indexes, else, when they will be used together, an error will occur.
$first integer The index of the first token used in this statement.
$last integer The index of the last token used in this statement.
$options SqlParser\Components\OptionsArray The options of this query.

Méthodes publiques

Méthode Description
__construct ( Parser $parser = null, TokensList $list = null ) Constructor.
__toString ( ) : string Builds the string representation of this statement.
after ( Parser $parser, TokensList $list, Token $token ) : void Function called after the token was processed.
before ( Parser $parser, TokensList $list, Token $token ) : void Function called before the token is processed.
build ( ) : string Builds the string representation of this statement.
getClauses ( ) : array Gets the clauses of this statement.
parse ( Parser $parser, TokensList $list ) : void Parses the statements defined by the tokens list.
validateClauseOrder ( Parser $parser, TokensList $list ) : boolean Validates the order of the clauses in parsed statement Ideally this should be called after successfully completing the parsing of each statement

Method Details

__construct() public méthode

Constructor.
public __construct ( Parser $parser = null, TokensList $list = null )
$parser Parser The instance that requests parsing.
$list TokensList The list of tokens to be parsed.

__toString() public méthode

Builds the string representation of this statement.
See also: static::build
public __toString ( ) : string
Résultat string

after() public méthode

Function called after the token was processed.
public after ( Parser $parser, TokensList $list, Token $token ) : void
$parser Parser The instance that requests parsing.
$list TokensList The list of tokens to be parsed.
$token Token The token that is being parsed.
Résultat void

before() public méthode

Function called before the token is processed.
public before ( Parser $parser, TokensList $list, Token $token ) : void
$parser Parser The instance that requests parsing.
$list TokensList The list of tokens to be parsed.
$token Token The token that is being parsed.
Résultat void

build() public méthode

Builds the string representation of this statement.
public build ( ) : string
Résultat string

getClauses() public méthode

Gets the clauses of this statement.
public getClauses ( ) : array
Résultat array

parse() public méthode

Parses the statements defined by the tokens list.
public parse ( Parser $parser, TokensList $list ) : void
$parser Parser The instance that requests parsing.
$list TokensList The list of tokens to be parsed.
Résultat void

validateClauseOrder() public méthode

Validates the order of the clauses in parsed statement Ideally this should be called after successfully completing the parsing of each statement
public validateClauseOrder ( Parser $parser, TokensList $list ) : boolean
$parser Parser The instance that requests parsing.
$list TokensList The list of tokens to be parsed.
Résultat boolean

Property Details

$CLAUSES public_oe static_oe property

The value attributed to each clause is used by the builder and it may have one of the following values: - 1 = 01 - add the clause only - 2 = 10 - add the keyword - 3 = 11 - add both the keyword and the clause
public static array $CLAUSES
Résultat array

$OPTIONS public_oe static_oe property

The option would be the key and the value can be an integer or an array. The integer represents only the index used. The array may have two keys: 0 is used to represent the index used and 1 is the type of the option (which may be 'var' or 'var='). Both options mean they expect a value after the option (e.g. A = B or A B, in which case A is the key and B is the value). The only difference is in the building process. var options are built as A B and var= options are built as A = B Two options that can be used together must have different values for indexes, else, when they will be used together, an error will occur.
public static array $OPTIONS
Résultat array

$first public_oe property

The index of the first token used in this statement.
public int $first
Résultat integer

$last public_oe property

The index of the last token used in this statement.
public int $last
Résultat integer

$options public_oe property

The options of this query.
See also: static::$OPTIONS
public OptionsArray,SqlParser\Components $options
Résultat SqlParser\Components\OptionsArray