Query
in package
Permet de générer des requêtes SQL plus facilement
Table of Contents
- $conditions : array<string|int, mixed>
- $delete : bool
- $insert : array<string|int, mixed>
- $join : array<string|int, mixed>
- $limit : mixed
- $offset : mixed
- $order : array<string|int, mixed>
- $selects : array<string|int, mixed>
- $table : array<string|int, mixed>
- $update : array<string|int, mixed>
- $values : array<string|int, mixed>
- __construct() : mixed
- __toString() : string
- Récupère sous forme de string
- addValue() : self
- count() : self
- delete() : self
- getValues() : array<string|int, mixed>
- insert() : self
- join() : self
- limit() : self
- order() : self
- select() : self
- setTable() : self
- toSql() : string
- Méthode pour récupérer la requête sous forme d'un chaîne de caractères
- update() : self
- where() : self
- buildConditions() : string
- buildDelete() : string
- buildFrom() : string
- buildInsert() : string
- buildJoin() : string
- buildLimit() : string
- buildOrder() : string
- buildSelect() : string
- buildUpdate() : string
- buildUpdateValues() : string
- clearString() : string
- Permet de nettoyer les espaces inutiles
- setValues() : mixed
Properties
$conditions
protected
array<string|int, mixed>
$conditions
= []
$delete
protected
bool
$delete
= false
$insert
protected
array<string|int, mixed>
$insert
= []
$join
protected
array<string|int, mixed>
$join
= ['type' => null, 'table' => null, 'on' => null]
$limit
protected
mixed
$limit
$offset
protected
mixed
$offset
$order
protected
array<string|int, mixed>
$order
= ['by' => null, 'order' => 'ASC']
$selects
protected
array<string|int, mixed>
$selects
= []
$table
protected
array<string|int, mixed>
$table
= []
$update
protected
array<string|int, mixed>
$update
= []
$values
protected
array<string|int, mixed>
$values
= []
Methods
__construct()
public
__construct() : mixed
Return values
mixed —__toString()
Récupère sous forme de string
public
__toString() : string
Return values
string —addValue()
public
addValue(string $key, mixed $value) : self
Parameters
- $key : string
- $value : mixed
Return values
self —count()
public
count(string $column) : self
Parameters
- $column : string
Return values
self —delete()
public
delete(string ...$conditions) : self
Parameters
- $conditions : string
Return values
self —getValues()
public
getValues() : array<string|int, mixed>
Return values
array<string|int, mixed> —insert()
public
insert(array<string|int, mixed> $infos) : self
Parameters
- $infos : array<string|int, mixed>
Return values
self —join()
public
join(string $table[, string $type = 'INNER' ], string ...$conditions) : self
Parameters
- $table : string
- $type : string = 'INNER'
- $conditions : string
Return values
self —limit()
public
limit(int $limit[, int $offset = null ]) : self
Parameters
- $limit : int
- $offset : int = null
Return values
self —order()
public
order(string $field[, string $order = 'ASC' ]) : self
Parameters
- $field : string
- $order : string = 'ASC'
Return values
self —select()
public
select(string ...$fields) : self
Parameters
- $fields : string
Return values
self —setTable()
public
setTable(string $table[, string $alias = null ]) : self
Parameters
- $table : string
- $alias : string = null
Return values
self —toSql()
Méthode pour récupérer la requête sous forme d'un chaîne de caractères
public
toSql() : string
Return values
string —update()
public
update(array<string|int, mixed> $infos) : self
Parameters
- $infos : array<string|int, mixed>
Return values
self —where()
public
where(string ...$condition) : self
Parameters
- $condition : string
Return values
self —buildConditions()
protected
buildConditions() : string
Return values
string —buildDelete()
protected
buildDelete() : string
Return values
string —buildFrom()
protected
buildFrom() : string
Return values
string —buildInsert()
protected
buildInsert() : string
Return values
string —buildJoin()
protected
buildJoin() : string
Return values
string —buildLimit()
protected
buildLimit() : string
Return values
string —buildOrder()
protected
buildOrder() : string
Return values
string —buildSelect()
protected
buildSelect() : string
Return values
string —buildUpdate()
protected
buildUpdate() : string
Return values
string —buildUpdateValues()
protected
buildUpdateValues(array<string|int, mixed> $values) : string
Parameters
- $values : array<string|int, mixed>
Return values
string —clearString()
Permet de nettoyer les espaces inutiles
protected
clearString(string $string) : string
Parameters
- $string : string
Return values
string —setValues()
protected
setValues(array<string|int, mixed> $requestValue, array<string|int, mixed> $values) : mixed
Parameters
- $requestValue : array<string|int, mixed>
- $values : array<string|int, mixed>