Property | Type | Description | |
---|---|---|---|
$FUNCTIONS | array | Functions that set the flag is_func. |
Method | Description | |
---|---|---|
getAll ( string $query ) : array | Parses a query and gets all information about it. | |
getClause ( |
Gets a specific clause. | |
getClauseStartOffset ( |
Gets a starting offset of a specific clause. | |
getFirstStatement ( string $query, string $delimiter = null ) : array | Gets the first full statement in the query. | |
getFlags ( |
Gets an array with flags this statement has. | |
getTables ( |
Gets a list of all tables used in this statement. | |
replaceClause ( |
Builds a query by rebuilding the statement from the tokens list supplied and replaces a clause. | |
replaceClauses ( |
Builds a query by rebuilding the statement from the tokens list supplied and replaces multiple clauses. |
public static getAll ( string $query ) : array | ||
$query | string | The query to be parsed. |
return | array | The array returned is the one returned by `static::getFlags()`, with the following keys added: - parser - the parser used to analyze the query; - statement - the first statement resulted from parsing; - select_tables - the real name of the tables selected; if there are no table names in the `SELECT` expressions, the table names are fetched from the `FROM` expressions - select_expr - selected expressions |
public static getClause ( |
||
$statement | The parsed query that has to be modified. | |
$list | The list of tokens. | |
$clause | string | The clause to be returned. |
$type | integer | string | The type of the search. If int, -1 for everything that was before 0 only for the clause 1 for everything after If string, the name of the first clause that should not be included. |
$skipFirst | boolean | Whether to skip the first keyword in clause. |
return | string |
public static getClauseStartOffset ( |
||
$statement | The parsed query that has to be modified. | |
$list | The list of tokens. | |
$clause | string | The clause to be returned. |
return | integer |
public static replaceClause ( |
||
$statement | The parsed query that has to be modified. | |
$list | The list of tokens. | |
$old | string | The type of the clause that should be replaced. This can be an entire clause. |
$new | string | The new clause. If this parameter is omitted it is considered to be equal with `$old`. |
$onlyType | boolean | Whether only the type of the clause should be replaced or the entire clause. |
return | string |
public static replaceClauses ( |
||
$statement | The parsed query that has to be modified. | |
$list | The list of tokens. | |
$ops | array | Clauses to be replaced. Contains multiple arrays having two values: array($old, $new). Clauses must be sorted. |
return | string |
public static array $FUNCTIONS | ||
return | array |