$sqlAdapter
$sqlAdapter : \Orpheus\SQLAdapter\SQLAdapter
The SQL Adapter
The main SQL Select Request class
This class handles sql SELECT request to the DMBS server.
$sqlAdapter : \Orpheus\SQLAdapter\SQLAdapter
The SQL Adapter
getClone(string $withParameters = true) : \Orpheus\SQLRequest\SQLRequest
Get a clone of current request
string | $withParameters | True to also copy parameters, default to true |
getSQLAdapter() : \Orpheus\SQLAdapter\SQLAdapter
Get the SQL Adapter
setSQLAdapter(\Orpheus\SQLAdapter\SQLAdapter $sqlAdapter)
Set the SQL Adapter
\Orpheus\SQLAdapter\SQLAdapter | $sqlAdapter |
from(string $table = null) : mixed|\Orpheus\SQLRequest\SQLRequest
Set/Get the table parameter
string | $table |
output(string $output = null) : mixed|\Orpheus\SQLRequest\SQLRequest
Set/Get the ouput parameter
string | $output |
select(\Orpheus\SQLAdapter\SQLAdapter $sqlAdapter = null, string $idField = 'id', string $class = null) : \Orpheus\SQLRequest\SQLSelectRequest
Create a select request
\Orpheus\SQLAdapter\SQLAdapter | $sqlAdapter | |
string | $idField | The ID field |
string | $class | The class used to instanciate entries |
setUsingCache(boolean $usingCache) : \Orpheus\SQLRequest\SQLSelectRequest
Set the class objects is using cache when getting results
boolean | $usingCache |
disableCache() : \Orpheus\SQLRequest\SQLSelectRequest
Disable the class objects' cache
fields(string|array<mixed,string> $fields = null) : mixed|\Orpheus\SQLRequest\SQLRequest
Set/Get the field list to get
string|array<mixed,string> | $fields |
addField(string $field) : \Orpheus\SQLRequest\SQLRequest
Add a field to to the field list
string | $field |
The current field list must be a string
having(string $condition = null) : mixed|\Orpheus\SQLRequest\SQLRequest
Set/Get the having condition
string | $condition |
where(string $condition, string $equality = null, string $value = null) : \Orpheus\SQLRequest\SQLSelectRequest
Set the whereclause
string | $condition | |
string | $equality | |
string | $value |
If only $condition is provided, this is used as complete string, e.g where("id = 5") If $equality & $value are provided, it uses it with $condition as a field (identifier), e.g where('id', '=', '5') where identifier and value are escaped with escapeIdentifier() & escapeValue() If $equality is provided but $value is not, $equality is the value and where are using a smart comparator, e.g where('id', '5') All examples return the same results. Smart comparator is IN for array values and = for all other.
orderby(string $fields = null) : mixed|\Orpheus\SQLRequest\SQLSelectRequest
Set/Get the order by filter
string | $fields |
groupby(string $field = null) : mixed|\Orpheus\SQLRequest\SQLSelectRequest
Set/Get the group by filter
string | $field |
number(integer $number = null) : mixed|\Orpheus\SQLRequest\SQLSelectRequest
Set/Get the number of expected result (as limit)
integer | $number |
maxRows(integer $number = null) : mixed|\Orpheus\SQLRequest\SQLSelectRequest
Set/Get the number of expected result (as limit)
integer | $number |
fromOffset(integer $offset = null) : mixed|\Orpheus\SQLRequest\SQLSelectRequest
Set/Get the offset from which we are getting results
integer | $offset |
join(string $join) : \Orpheus\SQLRequest\SQLSelectRequest
Add a join condition to this query
string | $join |
asObject() : \Orpheus\SQLRequest\SQLSelectRequest
Set the output to be an object
asObjectList() : \Orpheus\SQLRequest\SQLSelectRequest
Set the output to be a list of object
asArray() : \Orpheus\SQLRequest\SQLSelectRequest
Set the output to be an array
asArrayList() : \Orpheus\SQLRequest\SQLSelectRequest
Set the output to be a list of array
__construct(\Orpheus\SQLAdapter\SQLAdapter $sqlAdapter, string $idField, string $class = null)
Constructor
\Orpheus\SQLAdapter\SQLAdapter | $sqlAdapter | |
string | $idField | |
string | $class |
set(string $parameter, mixed $value) : \Orpheus\SQLRequest\SQLRequest
Set a parameter for this query
string | $parameter | |
mixed | $value |