DbQuery
in package
FinalYes
Permite realizar consultas a la base de datos de forma sencilla.
Table of Contents
Properties
- $fields : string
- $groupBy : string
- $having : string
- $limit : int
- $offset : int
- $orderBy : array<string|int, mixed>
- $db : DataBase
- $table : string
- $where : array<string|int, Where>
Methods
- __call() : mixed
- __construct() : mixed
- array() : array<string|int, mixed>
- avg() : float
- avgArray() : array<string|int, mixed>
- count() : int
- countArray() : array<string|int, mixed>
- delete() : bool
- first() : array<string|int, mixed>
- get() : array<string|int, mixed>
- groupBy() : self
- having() : self
- insert() : bool
- insertGetId() : int|null
- limit() : self
- max() : float
- maxArray() : array<string|int, mixed>
- maxString() : string
- min() : float
- minArray() : array<string|int, mixed>
- minString() : string
- offset() : self
- orderBy() : self
- orderMulti() : self
- reorder() : self
- select() : self
- selectRaw() : self
- sql() : string
- sum() : float
- sumArray() : array<string|int, mixed>
- table() : self
- update() : bool
- where() : $this
- whereBetween() : self
- whereEq() : self
- whereGt() : self
- whereGte() : self
- whereIn() : self
- whereLike() : self
- whereLt() : self
- whereLte() : self
- whereNotEq() : self
- whereNotIn() : self
- whereNotNull() : self
- whereNull() : self
- db() : DataBase
Properties
$fields
public
string
$fields
= '*'
$groupBy
public
string
$groupBy
$having
public
string
$having
$limit
public
int
$limit
= 0
$offset
public
int
$offset
= 0
$orderBy
public
array<string|int, mixed>
$orderBy
= []
$db
private
static DataBase
$db
$table
private
string
$table
$where
private
array<string|int, Where>
$where
= []
Methods
__call()
public
__call(mixed $method, mixed $parameters) : mixed
Parameters
- $method : mixed
- $parameters : mixed
__construct()
public
__construct(string $table) : mixed
Parameters
- $table : string
array()
public
array(string $key, string $value) : array<string|int, mixed>
Parameters
- $key : string
- $value : string
Return values
array<string|int, mixed>avg()
public
avg(string $field[, int|null $decimals = null ]) : float
Parameters
- $field : string
- $decimals : int|null = null
Return values
floatavgArray()
public
avgArray(string $field, string $groupByKey) : array<string|int, mixed>
Parameters
- $field : string
- $groupByKey : string
Return values
array<string|int, mixed>count()
public
count([string $field = '' ]) : int
Parameters
- $field : string = ''
Return values
intcountArray()
public
countArray(string $field, string $groupByKey) : array<string|int, mixed>
Parameters
- $field : string
- $groupByKey : string
Return values
array<string|int, mixed>delete()
public
delete() : bool
Return values
boolfirst()
public
first() : array<string|int, mixed>
Return values
array<string|int, mixed>get()
public
get() : array<string|int, mixed>
Return values
array<string|int, mixed>groupBy()
public
groupBy(string $fields) : self
Parameters
- $fields : string
Return values
selfhaving()
public
having(string $having) : self
Parameters
- $having : string
Return values
selfinsert()
public
insert(array<string|int, mixed> $data) : bool
Parameters
- $data : array<string|int, mixed>
Return values
boolinsertGetId()
public
insertGetId(array<string|int, mixed> $data) : int|null
Parameters
- $data : array<string|int, mixed>
Return values
int|nulllimit()
public
limit(int $limit) : self
Parameters
- $limit : int
Return values
selfmax()
public
max(string $field[, int|null $decimals = null ]) : float
Parameters
- $field : string
- $decimals : int|null = null
Return values
floatmaxArray()
public
maxArray(string $field, string $groupByKey) : array<string|int, mixed>
Parameters
- $field : string
- $groupByKey : string
Return values
array<string|int, mixed>maxString()
public
maxString(string $field) : string
Parameters
- $field : string
Return values
stringmin()
public
min(string $field[, int|null $decimals = null ]) : float
Parameters
- $field : string
- $decimals : int|null = null
Return values
floatminArray()
public
minArray(string $field, string $groupByKey) : array<string|int, mixed>
Parameters
- $field : string
- $groupByKey : string
Return values
array<string|int, mixed>minString()
public
minString(string $field) : string
Parameters
- $field : string
Return values
stringoffset()
public
offset(int $offset) : self
Parameters
- $offset : int
Return values
selforderBy()
public
orderBy(string $field[, string $order = 'ASC' ]) : self
Parameters
- $field : string
- $order : string = 'ASC'
Return values
selforderMulti()
public
orderMulti(array<string|int, mixed> $fields) : self
Parameters
- $fields : array<string|int, mixed>
Return values
selfreorder()
public
reorder() : self
Return values
selfselect()
public
select(string $fields) : self
Parameters
- $fields : string
Return values
selfselectRaw()
public
selectRaw(string $fields) : self
Parameters
- $fields : string
Return values
selfsql()
public
sql() : string
Return values
stringsum()
public
sum(string $field[, int|null $decimals = null ]) : float
Parameters
- $field : string
- $decimals : int|null = null
Return values
floatsumArray()
public
sumArray(string $field, string $groupByKey) : array<string|int, mixed>
Parameters
- $field : string
- $groupByKey : string
Return values
array<string|int, mixed>table()
public
static table(string $table) : self
Parameters
- $table : string
Return values
selfupdate()
public
update(array<string|int, mixed> $data) : bool
Parameters
- $data : array<string|int, mixed>
Return values
boolwhere()
public
where(array<string|int, Where> $where) : $this
Parameters
- $where : array<string|int, Where>
Tags
Return values
$thiswhereBetween()
public
whereBetween(string $field, mixed $value1, mixed $value2) : self
Parameters
- $field : string
- $value1 : mixed
- $value2 : mixed
Return values
selfwhereEq()
public
whereEq(string $field, mixed $value) : self
Parameters
- $field : string
- $value : mixed
Return values
selfwhereGt()
public
whereGt(string $field, mixed $value) : self
Parameters
- $field : string
- $value : mixed
Return values
selfwhereGte()
public
whereGte(string $field, mixed $value) : self
Parameters
- $field : string
- $value : mixed
Return values
selfwhereIn()
public
whereIn(string $field, array<string|int, mixed> $values) : self
Parameters
- $field : string
- $values : array<string|int, mixed>
Return values
selfwhereLike()
public
whereLike(string $field, string $value) : self
Parameters
- $field : string
- $value : string
Return values
selfwhereLt()
public
whereLt(string $field, mixed $value) : self
Parameters
- $field : string
- $value : mixed
Return values
selfwhereLte()
public
whereLte(string $field, mixed $value) : self
Parameters
- $field : string
- $value : mixed
Return values
selfwhereNotEq()
public
whereNotEq(string $field, mixed $value) : self
Parameters
- $field : string
- $value : mixed
Return values
selfwhereNotIn()
public
whereNotIn(string $field, array<string|int, mixed> $values) : self
Parameters
- $field : string
- $values : array<string|int, mixed>
Return values
selfwhereNotNull()
public
whereNotNull(string $field) : self
Parameters
- $field : string
Return values
selfwhereNull()
public
whereNull(string $field) : self
Parameters
- $field : string
Return values
selfdb()
private
static db() : DataBase