Documentation

CMySqlComposer extends CSqlComposerBase
in package

Class MySqlComposer

Table of Contents

$elements_per_page  : int
$page  : int
$params  : array<string|int, mixed>
__construct()  : mixed
Constructor
__toString()  : string
binding()  : void
Set the parameters for the binding
clear()  : mixed
Reset all internal data (like a new)
from()  : SqlComposerBase
fromList()  : SqlComposerBase
groupBy()  : SqlComposerBase
having()  : SqlComposerBase
innerJoin()  : SqlComposerBase
Sets the name of the table to INNER JOIN and its condition for crossing with a starting table
join()  : SqlComposerBase
Sets the name of the table to JOIN and its condition for crossing with a starting table
leftJoin()  : SqlComposerBase
Sets the name of the table to LEFT JOIN and its condition for crossing with a starting table
match()  : SqlComposerBase
orderBy()  : SqlComposerBase
outerJoin()  : SqlComposerBase
Sets the name of the table to OUTER JOIN and its condition for crossing with a starting table
paging()  : mixed
Impostazione dei parametri per l'impaginazione dei dati
prepare()  : string
SQL query composer according to the MySQL standard
rightJoin()  : SqlComposerBase
Sets the name of the table to RIGHT JOIN and its condition for crossing with a starting table
select()  : SqlComposerBase
Set the fields of the query
selectList()  : SqlComposerBase
Set the fields of the query
where()  : SqlComposerBase
_getTable()  : SqlComposerBase
_getTables()  : SqlComposerBase
_setJoin()  : SqlComposerBase
Sets the name of the table to join and its condition for crossing with a starting table

Properties

Methods

__construct()

Constructor

public __construct([string|null $table = null ]) : mixed
Parameters
$table : string|null = null

name of the default db table

Return values
mixed

__toString()

public __toString() : string
Return values
string

the string containing the query made up of all the parameters previously set

binding()

Set the parameters for the binding

public binding([array<string|int, mixed>|null $params = null ]) : void
Parameters
$params : array<string|int, mixed>|null = null

list of parameters deferred in the query by the placeholder "?"

Return values
void

from()

public from(string $table[, string|null $as = null ]) : SqlComposerBase
Parameters
$table : string

name of table

$as : string|null = null

alias table name

Return values
SqlComposerBase

$this this object

fromList()

public fromList(array<string|int, mixed> $tables) : SqlComposerBase
Parameters
$tables : array<string|int, mixed>

list of table name in the query

Return values
SqlComposerBase

$this this object

groupBy()

public groupBy(string $group_by) : SqlComposerBase
Parameters
$group_by : string

list of field names to group by

Return values
SqlComposerBase

$this this object

having()

public having(string $having) : SqlComposerBase
Parameters
$having : string

conditions for group by having

Return values
SqlComposerBase

$this this object

innerJoin()

Sets the name of the table to INNER JOIN and its condition for crossing with a starting table

public innerJoin(string $table, string $on_condition[, string|null $as = null ]) : SqlComposerBase
Parameters
$table : string

name of table

$on_condition : string

condition for crossing with a starting table

$as : string|null = null

alias table name

Return values
SqlComposerBase

$this this object

join()

Sets the name of the table to JOIN and its condition for crossing with a starting table

public join(string $table, string $on_condition[, string|null $as = null ]) : SqlComposerBase
Parameters
$table : string

name of table

$on_condition : string

condition for crossing with a starting table

$as : string|null = null

alias table name

Return values
SqlComposerBase

$this this object

leftJoin()

Sets the name of the table to LEFT JOIN and its condition for crossing with a starting table

public leftJoin(string $table, string $on_condition[, string|null $as = null ]) : SqlComposerBase
Parameters
$table : string

name of table

$on_condition : string

condition for crossing with a starting table

$as : string|null = null

alias table name

Return values
SqlComposerBase

$this this object

match()

public match(string $items, string $match) : SqlComposerBase
Parameters
$items : string
$match : string

condition for advanced search

Return values
SqlComposerBase

$this this object

orderBy()

public orderBy(array<string|int, mixed> $order_by) : SqlComposerBase
Parameters
$order_by : array<string|int, mixed>

list of field names to order by

Return values
SqlComposerBase

$this this object

outerJoin()

Sets the name of the table to OUTER JOIN and its condition for crossing with a starting table

public outerJoin(string $table, string $on_condition[, string|null $as = null ]) : SqlComposerBase
Parameters
$table : string

name of table

$on_condition : string

condition for crossing with a starting table

$as : string|null = null

alias table name

Return values
SqlComposerBase

$this this object

paging()

Impostazione dei parametri per l'impaginazione dei dati

public paging(int $page[, int $elements_per_page = 20 ]) : mixed
Parameters
$page : int
$elements_per_page : int = 20

maximum total of elements that make up a page

Return values
mixed

prepare()

SQL query composer according to the MySQL standard

public prepare() : string
Return values
string

the composed SQL code

rightJoin()

Sets the name of the table to RIGHT JOIN and its condition for crossing with a starting table

public rightJoin(string $table, string $on_condition[, string|null $as = null ]) : SqlComposerBase
Parameters
$table : string

name of table

$on_condition : string

condition for crossing with a starting table

$as : string|null = null

alias table name

Return values
SqlComposerBase

$this this object

select()

Set the fields of the query

public select(string $items) : SqlComposerBase
Parameters
$items : string

list of db fields separated by a comma

Return values
SqlComposerBase

$this this object

selectList()

Set the fields of the query

public selectList(array<string|int, mixed> $items) : SqlComposerBase
Parameters
$items : array<string|int, mixed>

array contains the list of db fields

Return values
SqlComposerBase

$this this object

where()

public where(string $conditions) : SqlComposerBase
Parameters
$conditions : string

WHERE conditions

Return values
SqlComposerBase

$this this object

_getTable()

private _getTable(string $type, string $table[, string|null $as = null ]) : SqlComposerBase
Parameters
$type : string

type table: TABLE|JOIN|LEFT JOIN

$table : string

name of table

$as : string|null = null

alias table name

Return values
SqlComposerBase

$this this object

_getTables()

private _getTables(string $type, array<string|int, mixed> $tables) : SqlComposerBase
Parameters
$type : string

type table: TABLE|JOIN|

$tables : array<string|int, mixed>

list of tables in an array containing the name and possibly its alias name (as)

Return values
SqlComposerBase

$this this object

_setJoin()

Sets the name of the table to join and its condition for crossing with a starting table

private _setJoin(string $join_type, string $table, string $on_condition[, string|null $as = null ]) : SqlComposerBase
Parameters
$join_type : string

type of join (LEFT JOIN, RIGHT JOIN, INNER JOIN, OUTER JOIN)

$table : string

name of table

$on_condition : string

condition for crossing with a starting table

$as : string|null = null

alias table name

Return values
SqlComposerBase

$this this object

Search results