PHP Class PHPSQLParser\processors\AbstractProcessor

Author: André Rothe ([email protected])
显示文件 Open project: greenlion/php-sql-parser Class Usage Examples

Protected Properties

Property Type Description
$options PHPSQLParser\Options

Public Methods

Method Description
__construct ( Options $options ) AbstractProcessor constructor.
process ( $tokens ) This function implements the main functionality of a processor class.
processComment ( $expression )
splitSQLIntoTokens ( $sql ) this function splits up a SQL statement into easy to "parse" tokens for the SQL processor
toArray ( $tokenList ) translates an array of objects into an associative array

Protected Methods

Method Description
array_insert_after ( $array, $key, $entry )
getVariableType ( $expression )
isAggregateFunction ( $out )
isBracketExpression ( $out )
isColumnReference ( $out )
isCommaToken ( $token )
isComment ( $out )
isCommentToken ( $token )
isConstant ( $out )
isCustomFunction ( $out )
isExpression ( $out )
isFunction ( $out )
isReserved ( $out )
isSubQuery ( $out )
isWhitespaceToken ( $token )
removeParenthesisFromStart ( $token ) This method removes parenthesis from start of the given string.
revokeQuotation ( $sql ) Revokes the quoting characters from an expression Possibibilies: a 'a' "a" a.b a.b a.b a.b It is also possible to have escaped quoting characters within an expression part: ab => ab And you can use whitespace between the parts: a . b => [a,b]

Method Details

__construct() public method

AbstractProcessor constructor.
public __construct ( Options $options )
$options PHPSQLParser\Options

array_insert_after() protected method

protected array_insert_after ( $array, $key, $entry )

getVariableType() protected method

protected getVariableType ( $expression )

isAggregateFunction() protected method

protected isAggregateFunction ( $out )

isBracketExpression() protected method

protected isBracketExpression ( $out )

isColumnReference() protected method

protected isColumnReference ( $out )

isCommaToken() protected method

protected isCommaToken ( $token )

isComment() protected method

protected isComment ( $out )

isCommentToken() protected method

protected isCommentToken ( $token )

isConstant() protected method

protected isConstant ( $out )

isCustomFunction() protected method

protected isCustomFunction ( $out )

isExpression() protected method

protected isExpression ( $out )

isFunction() protected method

protected isFunction ( $out )

isReserved() protected method

protected isReserved ( $out )

isSubQuery() protected method

protected isSubQuery ( $out )

isWhitespaceToken() protected method

protected isWhitespaceToken ( $token )

process() abstract public method

Always use default valuses for additional parameters within overridden functions.
abstract public process ( $tokens )

processComment() public method

public processComment ( $expression )

removeParenthesisFromStart() protected method

It removes also the associated closing parenthesis.
protected removeParenthesisFromStart ( $token )

revokeQuotation() protected method

Revokes the quoting characters from an expression Possibibilies: a 'a' "a" a.b a.b a.b a.b It is also possible to have escaped quoting characters within an expression part: ab => ab And you can use whitespace between the parts: a . b => [a,b]
protected revokeQuotation ( $sql )

splitSQLIntoTokens() public method

this function splits up a SQL statement into easy to "parse" tokens for the SQL processor
public splitSQLIntoTokens ( $sql )

toArray() public method

translates an array of objects into an associative array
public toArray ( $tokenList )

Property Details

$options protected_oe property

protected Options,PHPSQLParser $options
return PHPSQLParser\Options