com\setasign\SetaFramework\Database\Query
AbstractQuery Class AbstractQuery
File: /SetaFramework/src/Database/Query/AbstractQuery.php
Class hierarchy
Implements
Summary
Methods
- addFilter()
- addOn()
- getPart()
- getSql()
- getSqlFrom()
- getSqlJoin()
- getSqlLimit()
- getSqlOrderBy()
- getSqlWhere()
- getSqlWith()
- hasPart()
- join()
- joinInner()
- joinLeft()
- joinRight()
- joinStraight()
- limit()
- on()
- onOr()
- onOrParentheseOpen()
- onParentheseClose()
- onParentheseOpen()
- orderBy()
- processFilter()
- reset()
- where()
- whereOr()
- whereOrParentheseOpen()
- whereParentheseClose()
- whereParentheseOpen()
- whereXor()
- whereXorParentheseOpen()
- with()
- withRecursive()
Properties
Methods
addFilter()
string $logic,
string|\Closure $statementOrColumn,
?string $operator = null,
mixed $compareValue = null
Add a filter to a specific part
$statementOrColumn can be a Closure if $operator isn't set. The Closure will be called with (AbstractQuery $query, Database $quoteInterface) and has no return. $query won't be inserted directly, only the added parts of type $part will be used and set in parentheses.
Parameters
- $part : array
- $logic : string
Logic operator like "OR" or "AND" or "XOR", not important if this is the first element of a part
- $statementOrColumn : string|\Closure
- $operator : ?string
- $compareValue : mixed
By default, this will be quoted as a value.
addOn()
string|\Closure $statementOrColumn,
?string $operator = null,
mixed $compareValue = null
Adds a on-block to last added join
Parameters
- $logic : string
Logic operator like "OR" or "AND", not important if this is the first element of a part
- $statementOrColumn : string|\Closure
- $operator : ?string
- $compareValue : mixed
Exceptions
Throws \BadMethodCallException
getSql()
Returns the sql string of the query
Parameters
- $quoteInterface : \com\setasign\SetaFramework\Database\QuoteInterface
getSqlFrom()
Parses the from-block to string
Parameters
- $quoteInterface : \com\setasign\SetaFramework\Database\QuoteInterface
getSqlJoin()
Parses the join block to string
Parameters
- $quoteInterface : \com\setasign\SetaFramework\Database\QuoteInterface
getSqlLimit()
Parses the limit block to string
Parameters
- $quoteInterface : \com\setasign\SetaFramework\Database\QuoteInterface
getSqlOrderBy()
Parses the orderBy block to string
Parameters
- $quoteInterface : \com\setasign\SetaFramework\Database\QuoteInterface
getSqlWhere()
Parses the where block to string
Parameters
- $quoteInterface : \com\setasign\SetaFramework\Database\QuoteInterface
getSqlWith()
Parameters
- $quoteInterface : \com\setasign\SetaFramework\Database\QuoteInterface
join()
string $joinType = '',
IndexHintList|IndexHintList[] $indexHintList = array ( )
Adds a join to query
Parameters
joinInner()
joinLeft()
joinRight()
joinStraight()
on()
?string $operator = null,
mixed $compareValue = null
Adds a ON-AND-condition to last added join
Parameters
- $statementOrColumn : string|array|Select|\Closure|\com\setasign\SetaFramework\Database\ExpressionInterface
By default, this will be quoted as an identifier.
- $operator : ?string
- $compareValue : mixed
By default, this will be quoted as an identifier.
Exceptions
Throws \BadMethodCallException
onOr()
?string $operator = null,
?string $compareValue = null
Adds a ON-OR-condition to last added join
Parameters
- $statementOrColumn : string|array|Select|\Closure|\com\setasign\SetaFramework\Database\ExpressionInterface
By default, this will be quoted as an identifier.
- $operator : ?string
- $compareValue : ?string
By default, this will be quoted as an identifier.
onOrParentheseOpen()
Starts a ON-OR-condition-block in parentheses to last added join
There is no autoclosing of parentheses.
Parameters
- $reverse : bool
Reverse result of parenthese with prefix NOT
onParentheseOpen()
Starts a ON-AND-condition-block in parentheses to last added join
There is no autoclosing of parentheses.
Parameters
- $reverse : bool
Reverse result of parenthese with prefix NOT
orderBy()
string $direction = 'ASC'
Adds an order-by-column to query
Parameters
- $column : string|Select|\Closure|\com\setasign\SetaFramework\Database\ExpressionInterface
By default, quoted as an identifier.
- $direction : string
'ASC' or 'DESC'
processFilter()
Parses a single part to string
Parameters
- $parts : array
- $quoteInterface : \com\setasign\SetaFramework\Database\QuoteInterface
- $mainPart : string
Exceptions
Throws \InvalidArgumentException
where()
?string $operator = null,
mixed $compareValue = null
Adds a WHERE-AND-condition to where part
Parameters
- $statementOrColumn : string|int|\Closure|\com\setasign\SetaFramework\Database\ExpressionInterface
By default, quoted as an identifier.
- $operator : ?string
- $compareValue : mixed
By default, this will be quoted as a value.
whereOr()
?string $operator = null,
mixed $compareValue = null
Adds a WHERE-OR-condition to where part
Parameters
- $statementOrColumn : string|int|\Closure|\com\setasign\SetaFramework\Database\ExpressionInterface
By default, quoted as an identifier.
- $operator : ?string
- $compareValue : mixed
By default, this will be quoted as a value.
whereOrParentheseOpen()
Starts an WHERE-OR-condition-block in parentheses
There is no autoclosing of parentheses.
Parameters
- $reverse : bool
Reverse result of parenthese with prefix NOT
whereParentheseOpen()
Starts an WHERE-AND-condition-block in parentheses
There is no autoclosing of parentheses.
Parameters
- $reverse : bool
Reverse result of parenthese with prefix NOT
whereXor()
?string $operator = null,
mixed $compareValue = null
Adds a WHERE-XOR-condition to where part
Parameters
- $statementOrColumn : string|int|\Closure|\com\setasign\SetaFramework\Database\ExpressionInterface
By default, quoted as an identifier.
- $operator : ?string
- $compareValue : mixed
By default, this will be quoted as a value.
whereXorParentheseOpen()
Starts an WHERE-XOR-condition-block in parentheses
There is no autoclosing of parentheses.
Parameters
- $reverse : bool
Reverse result of parenthese with prefix NOT
