Index

SelectStatement

MMO\pdo\statements · 1 symbol · generated 5 Oct 2026

class

SelectStatement

SelectStatement.php:20
class MMO\pdo\statements\SelectStatement extends MMO\pdo\statements\FilterStatement
Namespace
MMO\pdo\statements
Extends
FilterStatement

Constants1

JOINS_KEY

const JOINS_KEY = 'joins'

Methods11

getJoins()

SelectStatement.php:110
function getJoins(): array
returnsarraythe joins added so far, as [['type' => ?string, 'tables' => array, 'on' => array], …].

join($tables, $alias, $type)

SelectStatement.php:76

Join one or more tables.

function join(array|string $tables, ?string $alias = null, ?string $type = null): self
$tablesarray | stringa table name, or [alias => name, …], or a list of names. Several tables given at once are joined as one parenthesised group (LEFT JOIN (t2,t3,t4) ON …), which is the form that takes a single shared ON.
$alias = nullnull | stringan alias for a single table
$type = nullnull | stringINNER, LEFT, RIGHT, FULL, CROSS … (a plain JOIN when omitted)
returnsself
$stmt->from(['t1' => 'employee'])->join('info', 't2', 'INNER')->on('t1.name = t2.name');

on($conditions)

SelectStatement.php:99

Add conditions to the join started by the last join, AND-ed together.

function on(string ...$conditions): selfThese are raw SQL fragments, NOT an [`iFilter`](https://mcp.mmoframework.fr/documentation/mmo.core/php/interfaces/iFilter.md#ifilter): a join compares two COLUMNS (`t1.id = t2.id`), while a filter compares a column to a VALUE it would bind -- `['t1.id' => 't2.id']` would look for the literal string `'t2.id'`.
...$conditionsstring
returnsself
throwsif no join has been started
Inherited members (61)
ConstantsDeclared byDescription
ALL_FLAGStatement
CREATE_IF_NOT_EXISTS_FLAGStatement
CREATE_TEMPORARY_FLAGStatement
DELAYED_FLAGStatement
DISTINCT_FLAGStatement
DISTINCT_ROW_FLAGStatement
HIGH_PRIORITY_FLAGStatement
IF_EXISTS_FLAGStatement
IGNORE_FLAGStatement
LIMIT_KEYFilterStatement
LOW_PRIORITY_FLAGStatement
MAX_LIMITFilterStatement
ORDER_KEYFilterStatement
QUICK_FLAGStatement
STRAIGHT_JOIN_FLAGStatement
WHERE_KEYFilterStatementReserved content keys for the trailing clauses this class appends to every template.
PropertiesDeclared byDescription
contentStatement
handlerStatement
optsStatement
stmtStatement
templateStatement
MethodsDeclared byDescription
addOptions($opts, $appendList)StatementMerge $opts into the existing options (through merge), rather than replacing them wholesale like setOptions.
bindValue($pdo, $index, $value, $type, $binds)StatementBind one already-emitted value onto the PDO statement.
clear()StatementEmpty the underlying content, keeping the object itself.
clearOptions()StatementEmpty the options bag.
count()Statement\Countable::count
execute()StatementExecute the query and set the current statement
fetch($opt)StatementFetch the first row of the query's result
fetchAll($clear)StatementFetch all the result of a query
fetchAllObjects($class, $constructFirst, $args, $clear)StatementFetch all the result of a query as Objects.
fetchObject($class, $constructFirst, $args)StatementFetch the result of a query as an Object.
fetchValue($key)StatementFetch the column's value of the first row of the query's result and advance fetch pointer
fetchValues($key)StatementFetch the column's value of all the row of the query's result
flag($key, $flag, $set)Statement
getFilter()FilterStatement
getIterator()Statement\IteratorAggregate::getIterator
getOption($key, $default)Statement
getOptions()Statement
getPDOStatement()Statement
getPlaceholders()StatementExtract placeholder from template
isEmpty()Statement
jsonSerialize()Statement\JsonSerializable::jsonSerialize -- the raw content is returned as-is (not recursively converted), so json_encode() relies on any nested iArray values being JsonSerializable themselves.
keys()Statement
limit($count, $offset)FilterStatement
loadArray($data)StatementLoad every entry of a plain array into the content, through offsetSet (so any offsetSet() override defined by the class using this trait, e.g.
offsetExists($key)Statement\ArrayAccess::offsetExists
offsetGet($key)Statement\ArrayAccess::offsetGet
offsetSet($key, $value)Statement\ArrayAccess::offsetSet -- a null $key appends ($bag[] = $value), like a plain PHP array.
offsetUnset($key)Statement\ArrayAccess::offsetUnset -- on a list (sequential integer keys, as produced by $bag[] = ...), the element is spliced out (closing the gap and reindexing), matching \unset() semantics on a plain …
order($fields)FilterStatement
prepare($binds, $sql)StatementPrepare a PDO statement by binding values.
push($key, $fields)Statement
render($opts)Statement
reset()Statement
rowCount()Statement
setFilter($filter)FilterStatement
setOption($key, $value)StatementSet (or, with a null $value, remove) a single option.
setOptions($opts)StatementReplace the whole options bag.
SplitType($key)StatementSplit a column:type key used by the INSERT/UPDATE value lists.
toArray()StatementConvert the content to a plain array, recursively converting any nested iArray value (e.g.
__toString()Statement