Query
class Query (View source)
Statement utilities.
Properties
static string[] | $functions | Functions that set the flag |
Methods
Gets an array with flags this statement has.
Parses a query and gets all information about it.
Gets a specific clause.
Builds a query by rebuilding the statement from the tokens list supplied and replaces a clause.
Builds a query by rebuilding the statement from the tokens list supplied and replaces multiple clauses.
Gets the first full statement in the query.
Gets a starting offset of a specific clause.
Details
static StatementFlags
getFlags(Statement|null $statement)
Gets an array with flags this statement has.
static StatementInfo
getAll(string $query)
Parses a query and gets all information about it.
static array
getTables(Statement $statement)
Gets a list of all tables used in this statement.
static string
getClause(Statement $statement, TokensList $list, string $clause, int|string $type = 0, bool $skipFirst = true)
Gets a specific clause.
static string
replaceClause(Statement $statement, TokensList $list, string $old, string|null $new = null, bool $onlyType = false)
Builds a query by rebuilding the statement from the tokens list supplied and replaces a clause.
It is a very basic version of a query builder.
static string
replaceClauses(Statement $statement, TokensList $list, array $ops)
Builds a query by rebuilding the statement from the tokens list supplied and replaces multiple clauses.
static array
getFirstStatement(string $query, string|null $delimiter = null)
Gets the first full statement in the query.
static int
getClauseStartOffset(Statement $statement, TokensList $list, string $clause)
Gets a starting offset of a specific clause.