PHP 클래스 SqlParser\Statement

저자: Dan Ungureanu ([email protected])
파일 보기 프로젝트 열기: phpmyadmin/sql-parser 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$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.

공개 메소드들

메소드 설명
__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

메소드 상세

__construct() 공개 메소드

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() 공개 메소드

Builds the string representation of this statement.
또한 보기: static::build
public __toString ( ) : string
리턴 string

after() 공개 메소드

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.
리턴 void

before() 공개 메소드

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.
리턴 void

build() 공개 메소드

Builds the string representation of this statement.
public build ( ) : string
리턴 string

getClauses() 공개 메소드

Gets the clauses of this statement.
public getClauses ( ) : array
리턴 array

parse() 공개 메소드

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.
리턴 void

validateClauseOrder() 공개 메소드

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.
리턴 boolean

프로퍼티 상세

$CLAUSES 공개적으로 정적으로 프로퍼티

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
리턴 array

$OPTIONS 공개적으로 정적으로 프로퍼티

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
리턴 array

$first 공개적으로 프로퍼티

The index of the first token used in this statement.
public int $first
리턴 integer

$last 공개적으로 프로퍼티

The index of the last token used in this statement.
public int $last
리턴 integer

$options 공개적으로 프로퍼티

The options of this query.
또한 보기: static::$OPTIONS
public OptionsArray,SqlParser\Components $options
리턴 SqlParser\Components\OptionsArray