\startmvc\coreDb

Summary

Methods
Properties
Constants
__construct()
grouped()
select()
count()
sum()
avg()
min()
max()
table()
from()
join()
leftJoin()
leftOuterJoin()
rightJoin()
rightOuterJoin()
innerJoin()
fullOuterJoin()
joinBuild()
joinNode()
nodeParser()
order()
orderBuild()
group()
groupBuild()
limit()
offset()
pager()
pagerRows()
pagerLinks()
pagerData()
setPagerTemplate()
limitOffsetBuild()
having()
havingBuild()
where()
orWhere()
notWhere()
orNotWhere()
isNull()
orIsNull()
notNull()
orNotNull()
in()
orIn()
notIn()
orNotIn()
between()
orBetween()
notBetween()
orNotBetween()
findInSet()
orFindInSet()
notFindInSet()
orNotFindInSet()
like()
orLike()
notLike()
orNotlike()
findMarker()
createMarker()
createMarkerWithKey()
addWhereParams()
addJoinParams()
addHavingParams()
addRawParams()
query()
exec()
whereFactory()
getReadParams()
getReadQuery()
getReadQueryRaw()
cache()
getReadHash()
readQuery()
total()
get()
first()
value()
column()
toArray()
toObject()
toJson()
find()
validate()
filter()
filterData()
insert()
insertReplace()
insertIgnore()
upsert()
update()
touch()
inc()
dec()
delete()
truncate()
drop()
optimize()
analyze()
check()
checksum()
repair()
showTable()
getPrimary()
inTransaction()
beginTransaction()
commit()
rollBack()
quote()
lastInsertId()
rowCount()
queryCount()
queryHistory()
lastQuery()
lastParams()
addQueryHistory()
killQuery()
close()
No public properties found
No constants found
init()
setGroup()
selectBuild()
selectFlush()
selectFunctions()
tableBuild()
whereBuild()
whereBuildRaw()
addParams()
delParams()
trace()
runStructureTool()
No protected properties found
N/A
getQueryForDriver()
sqliteColParser()
mysqlColParser()
$pdo
$config
$fetchMode
$toJson
$queryHistory
$rowCount
$rawQuery
$select
$table
$join
$where
$order
$group
$having
$limit
$offset
$pager
$pagerRows
$pagerData
$pagerTemplate
$pagerHtml
$isGrouped
$isGroupIn
$isFilter
$isFilterValid
$joinNodes
$joinParams
$havingParams
$whereParams
$rawParams
$cache
$cacheType
$prefix
$redisActive
N/A

Properties

$pdo

$pdo

$config

$config

$fetchMode

$fetchMode

$toJson

$toJson

$queryHistory

$queryHistory

$rowCount

$rowCount

$rawQuery

$rawQuery

$select

$select

$table

$table

$join

$join

$where

$where

$order

$order

$group

$group

$having

$having

$limit

$limit

$offset

$offset

$pager

$pager

$pagerRows

$pagerRows

$pagerData

$pagerData

$pagerTemplate

$pagerTemplate

$pagerHtml

$pagerHtml

$isGrouped

$isGrouped

$isGroupIn

$isGroupIn

$isFilter

$isFilter

$isFilterValid

$isFilterValid

$joinNodes

$joinNodes

$joinParams

$joinParams

$havingParams

$havingParams

$whereParams

$whereParams

$rawParams

$rawParams

$cache

$cache

$cacheType

$cacheType

$prefix

$prefix

$redisActive

$redisActive

Methods

__construct()

__construct(array  $config = null) : mixed

__construct

Parameters

array $config

Returns

mixed —

grouped()

grouped(\startmvc\core\closure  $object) : $this

Closure and-or grouping

Parameters

\startmvc\core\closure $object

Returns

$this —

select()

select(string|array  $fields) : $this

select

Parameters

string|array $fields

Returns

$this —

count()

count(string  $field = '*', string  $alias = null) : $this

count

Parameters

string $field
string $alias

Returns

$this —

sum()

sum(string  $field, string  $alias = null) : $this

sum

Parameters

string $field
string $alias

Returns

$this —

avg()

avg(string  $field, string  $alias = null) : $this

avg

Parameters

string $field
string $alias

Returns

$this —

min()

min(string  $field, string  $alias = null) : $this

min

Parameters

string $field
string $alias

Returns

$this —

max()

max(string  $field, string  $alias = null) : $this

max

Parameters

string $field
string $alias

Returns

$this —

table()

table(string|array  $table, mixed  $as = null) : $this

table

Parameters

string|array $table
mixed $as

Returns

$this —

from()

from(string|array  $table, mixed  $as = null) : $this

from alias table

Parameters

string|array $table
mixed $as

Returns

$this —

join()

join(string  $from, string  $field = null, string  $params = null, string  $join = 'INNER') : $this

join

Parameters

string $from
string $field
string $params
string $join

Returns

$this —

leftJoin()

leftJoin(string  $from, string  $on = null, string  $params = null) : $this

leftJoin

Parameters

string $from
string $on
string $params

Returns

$this —

leftOuterJoin()

leftOuterJoin(string  $from, string  $on = null, string  $params = null) : $this

leftOuterJoin

Parameters

string $from
string $on
string $params

Returns

$this —

rightJoin()

rightJoin(string  $from, string  $on = null, string  $params = null) : $this

rightJoin

Parameters

string $from
string $on
string $params

Returns

$this —

rightOuterJoin()

rightOuterJoin(string  $from, string  $on = null, string  $params = null) : $this

rightOuterJoin

Parameters

string $from
string $on
string $params

Returns

$this —

innerJoin()

innerJoin(string  $from, string  $on = null, string  $params = null) : $this

innerJoin

Parameters

string $from
string $on
string $params

Returns

$this —

fullOuterJoin()

fullOuterJoin(string  $from, string  $on = null, string  $params = null) : $this

fullOuterJoin

Parameters

string $from
string $on
string $params

Returns

$this —

joinBuild()

joinBuild() : $this

joinBuild

Returns

$this —

joinNode()

joinNode(string  $alias, array  $columns) : $this

joinNode

Parameters

string $alias
array $columns

Returns

$this —

nodeParser()

nodeParser(mixed  $results) : array|object

nodeParser

Parameters

mixed $results

Returns

array|object —

order()

order(string|array  $order, string  $dir = null) : $this

order

Parameters

string|array $order
string $dir

Returns

$this —

orderBuild()

orderBuild() : string

orderBuild

Returns

string —

group()

group(string|array  $group) : $this

group

Parameters

string|array $group

Returns

$this —

groupBuild()

groupBuild() : mixed

Returns

mixed —

limit()

limit(int  $limit, int  $offset = null) : $this

limit

Parameters

int $limit
int $offset

Returns

$this —

offset()

offset(int  $offset) : $this

offset

Parameters

int $offset

Returns

$this —

pager()

pager(mixed  $limit, mixed  $page = 1) : $this

pager

Parameters

mixed $limit
mixed $page

Returns

$this —

pagerRows()

pagerRows(mixed  $total) : $this

pagerRows

Parameters

mixed $total

Returns

$this —

pagerLinks()

pagerLinks(mixed  $url = '?page={page}', mixed  $class = 'active') : void

pagerLinks

Parameters

mixed $url
mixed $class

pagerData()

pagerData() : void

pagerData

setPagerTemplate()

setPagerTemplate(mixed  $template) : void

pagerData

Parameters

mixed $template

limitOffsetBuild()

limitOffsetBuild() : string

limitOffsetBuild

Returns

string —

having()

having(string|array  $field, string  $value = null) : $this

having

Parameters

string|array $field
string $value

Returns

$this —

havingBuild()

havingBuild() : void

havingBuild

where()

where(string|array  $column, string|array  $value = null, string  $andOr = _AND) : $this

where

Parameters

string|array $column
string|array $value
string $andOr

Returns

$this —

orWhere()

orWhere(string|array  $column, string|array  $value = null) : $this

orWhere

Parameters

string|array $column
string|array $value

Returns

$this —

notWhere()

notWhere(string|array  $column, string|array  $value = null, string  $andOr = _AND) : $this

notWhere

Parameters

string|array $column
string|array $value
string $andOr

Returns

$this —

orNotWhere()

orNotWhere(string|array  $column, string|array  $value = null) : $this

orNotWhere

Parameters

string|array $column
string|array $value

Returns

$this —

isNull()

isNull(string|array  $column, string  $group = null, string  $andOr = _AND) : $this

isNull

Parameters

string|array $column
string $group
string $andOr

Returns

$this —

orIsNull()

orIsNull(string|array  $column, string  $group = null) : $this

orIsNull

Parameters

string|array $column
string $group

Returns

$this —

notNull()

notNull(string|array  $column, string  $group = null, string  $andOr = _AND) : $this

notNull

Parameters

string|array $column
string $group
string $andOr

Returns

$this —

orNotNull()

orNotNull(string|array  $column, string  $group = null) : $this

orNotNull

Parameters

string|array $column
string $group

Returns

$this —

in()

in(string  $column, array  $value, string  $andOr = _AND) : $this

in

Parameters

string $column
array $value
string $andOr

Returns

$this —

orIn()

orIn(string  $column, array  $value) : $this

orIn

Parameters

string $column
array $value

Returns

$this —

notIn()

notIn(string  $column, array  $value, mixed  $andOr = _AND) : $this

notIn

Parameters

string $column
array $value
mixed $andOr

Returns

$this —

orNotIn()

orNotIn(string  $column, array  $value) : $this

orNotIn

Parameters

string $column
array $value

Returns

$this —

between()

between(string  $column, int  $begin, int  $end, string  $andOr = _AND) : $this

between

Parameters

string $column
int $begin
int $end
string $andOr

Returns

$this —

orBetween()

orBetween(string  $column, int  $begin, int  $end) : $this

orBetween

Parameters

string $column
int $begin
int $end

Returns

$this —

notBetween()

notBetween(string  $column, int  $begin, int  $end, string  $andOr = _AND) : $this

notBetween

Parameters

string $column
int $begin
int $end
string $andOr

Returns

$this —

orNotBetween()

orNotBetween(string  $column, int  $begin, int  $end) : $this

orNotBetween

Parameters

string $column
int $begin
int $end

Returns

$this —

findInSet()

findInSet(string  $column, string  $search, string  $andOr = _AND) : $this

findInSet

Parameters

string $column
string $search
string $andOr

Returns

$this —

orFindInSet()

orFindInSet(string  $column, string  $search) : $this

orFindInSet

Parameters

string $column
string $search

Returns

$this —

notFindInSet()

notFindInSet(string  $column, string  $search, string  $andOr = _AND) : $this

notFindInSet

Parameters

string $column
string $search
string $andOr

Returns

$this —

orNotFindInSet()

orNotFindInSet(string  $column, string  $search) : $this

orNotFindInSet

Parameters

string $column
string $search

Returns

$this —

like()

like(string  $column, string|array  $search, string  $group = null, string  $andOr = _AND, string  $pattern = '%s LIKE ?') : $this

like

Parameters

string $column
string|array $search
string $group
string $andOr
string $pattern

Returns

$this —

orLike()

orLike(string  $column, string|array  $search, string  $group = null) : $this

orLike

Parameters

string $column
string|array $search
string $group

Returns

$this —

notLike()

notLike(string  $column, string|array  $search, string  $group = null) : $this

notLike

Parameters

string $column
string|array $search
string $group

Returns

$this —

orNotlike()

orNotlike(string  $column, string|array  $search, string  $group = null) : $this

orNotlike

Parameters

string $column
string|array $search
string $group

Returns

$this —

findMarker()

findMarker(string  $string) : bool

Search for a marker within a string

Parameters

string $string

Returns

bool —

createMarker()

createMarker(mixed  $params) : string

Creates as many markers as parameters for the query

Parameters

mixed $params

Returns

string —

createMarkerWithKey()

createMarkerWithKey(array  $params, string  $pattern = '%key=?', mixed  $comma = ',') : string

Creates pattern for query

Parameters

array $params
string $pattern
mixed $comma

Returns

string —

addWhereParams()

addWhereParams(array  $params) : void

addWhereParams

Parameters

array $params

addJoinParams()

addJoinParams(array  $params) : void

addJoinParams

Parameters

array $params

addHavingParams()

addHavingParams(array  $params) : void

addHavingParams

Parameters

array $params

addRawParams()

addRawParams(array  $params) : void

addRawParams

Parameters

array $params

query()

query(string  $query, string|array  $params = null) : $this

raw

Parameters

string $query
string|array $params

Returns

$this —

exec()

exec() : int

exec

Returns

int —

whereFactory()

whereFactory(string|array  $column, string|array  $value = null, string  $andOr = _AND, string  $pattern = "%s=?", bool  $withoutParam = false) : $this

whereFactory

Parameters

string|array $column
string|array $value
string $andOr
string $pattern
bool $withoutParam

Returns

$this —

getReadParams()

getReadParams() : array

getReadParams

Returns

array —

getReadQuery()

getReadQuery(mixed  $deny = []) : string

getReadQuery

Parameters

mixed $deny

Returns

string —

getReadQueryRaw()

getReadQueryRaw(mixed  $deny = []) : string

getReadQueryRaw

Parameters

mixed $deny

Returns

string —

cache()

cache(int  $timeout = null, string  $cacheType = 'file') : $this

cache

Parameters

int $timeout
string $cacheType

Returns

$this —

getReadHash()

getReadHash() : string

getReadHash

Returns

string —

readQuery()

readQuery(string  $fetch = 'fetch', void  $fetchMode = null) : mixed

readQuery

Parameters

string $fetch
void $fetchMode

Returns

mixed —

total()

total(mixed  $table = null) : mixed

total

Parameters

mixed $table

Returns

mixed —

get()

get(mixed  $table = null) : void

get

Parameters

mixed $table

first()

first(mixed  $table = null) : void

first

Parameters

mixed $table

value()

value(mixed  $column) : void

value

Parameters

mixed $column

column()

column(mixed  $value, mixed  $key = null) : void

column/pluck

Parameters

mixed $value
mixed $key

toArray()

toArray() : $this

toArray

Returns

$this —

toObject()

toObject() : $this

toObject

Returns

$this —

toJson()

toJson() : $this

toJson

Returns

$this —

find()

find(mixed  $value, mixed  $table = null) : mixed

find

Parameters

mixed $value
mixed $table

Returns

mixed —

validate()

validate() : $this

validate

Returns

$this —

filter()

filter(bool  $forceValid = false) : $this

filter

Parameters

bool $forceValid

Returns

$this —

filterData()

filterData(string  $table, array  $insertData, bool  $forceValid = false) : array

filterData

Parameters

string $table
array $insertData
bool $forceValid

Returns

array —

insert()

insert(array  $insertData, string  $table = null, string  $type = 'INSERT') : int|bool

insert

Parameters

array $insertData
string $table
string $type

Returns

int|bool —

insertReplace()

insertReplace(array  $insertData, string  $table = null) : int|bool

insertReplace

Parameters

array $insertData
string $table

Returns

int|bool —

insertIgnore()

insertIgnore(array  $insertData, string  $table = null) : int|bool

insertIgnore

Parameters

array $insertData
string $table

Returns

int|bool —

upsert()

upsert(array  $insertData, string  $table = null) : int|bool

upsert

Parameters

array $insertData
string $table

Returns

int|bool —

update()

update(array  $data, string  $table = null) : int|bool

update

Parameters

array $data
string $table

Returns

int|bool —

touch()

touch(string  $column) : int|bool

touch

Parameters

string $column

Returns

int|bool —

inc()

inc(string  $column, int  $count = 1, mixed  $operator = '+') : int|bool

increment

Parameters

string $column
int $count
mixed $operator

Returns

int|bool —

dec()

dec(string  $column, int  $count = 1) : int|bool

decrement

Parameters

string $column
int $count

Returns

int|bool —

delete()

delete(string  $table = null) : int|bool

delete

Parameters

string $table

Returns

int|bool —

truncate()

truncate(mixed  $table = null) : mixed

Parameters

mixed $table

Returns

mixed —

drop()

drop(mixed  $table = null) : mixed

Parameters

mixed $table

Returns

mixed —

optimize()

optimize(mixed  $table = null) : mixed

Parameters

mixed $table

Returns

mixed —

analyze()

analyze(mixed  $table = null) : mixed

Parameters

mixed $table

Returns

mixed —

check()

check(mixed  $table = null) : mixed

Parameters

mixed $table

Returns

mixed —

checksum()

checksum(mixed  $table = null) : mixed

Parameters

mixed $table

Returns

mixed —

repair()

repair(mixed  $table = null) : mixed

Parameters

mixed $table

Returns

mixed —

showTable()

showTable(string  $table = null) : array

showTable

Parameters

string $table

Returns

array —

getPrimary()

getPrimary(string  $table = null) : void

getPrimary

Parameters

string $table

inTransaction()

inTransaction() : void

inTransaction

beginTransaction()

beginTransaction() : void

beginTransaction

commit()

commit() : void

commit

rollBack()

rollBack() : void

rollBack

quote()

quote(mixed  $data) : string

quote

Parameters

mixed $data

Returns

string —

lastInsertId()

lastInsertId() : int

lastInsertId

Returns

int —

rowCount()

rowCount() : int

rowCount

Returns

int —

queryCount()

queryCount() : int

queryCount

Returns

int —

queryHistory()

queryHistory() : array

queryHistory

Returns

array —

lastQuery()

lastQuery(bool  $withParams = false) : string|array

lastQuery

Parameters

bool $withParams

Returns

string|array —

lastParams()

lastParams() : array

lastParams

Returns

array —

addQueryHistory()

addQueryHistory(string  $query, string|array  $params = null, mixed  $rowCount, mixed  $from = null) : array

addQueryHistory

Parameters

string $query
string|array $params
mixed $rowCount
mixed $from

Returns

array —

killQuery()

killQuery(string  $query, string|array  $params = null, mixed  $rowCount, mixed  $from = null) : void

killQuery

Parameters

string $query
string|array $params
mixed $rowCount
mixed $from

close()

close() : void

close

init()

init() : mixed

init

Returns

mixed —

setGroup()

setGroup(bool  $andOr = false) : mixed

The AND-OR grouping in the query

Parameters

bool $andOr

Returns

mixed —

selectBuild()

selectBuild() : string

selectBuild

Returns

string —

selectFlush()

selectFlush(mixed  $select = null) : mixed

selectInit

Parameters

mixed $select

Returns

mixed —

selectFunctions()

selectFunctions(string  $field, string  $alias = null, string  $function = null) : mixed

selectFunctions

Parameters

string $field
string $alias
string $function

Returns

mixed —

tableBuild()

tableBuild() : string

tableBuild

Returns

string —

whereBuild()

whereBuild() : string

whereBuild

Returns

string —

whereBuildRaw()

whereBuildRaw() : string

whereBuildRaw

Returns

string —

addParams()

addParams(array  $params, string  $type = 'whereParams') : void

addParams

Parameters

array $params
string $type

delParams()

delParams(string  $key) : void

delParams

Parameters

string $key

trace()

trace(mixed  $res, mixed  $startTime, mixed  $sql = null) : mixed

Parameters

mixed $res
mixed $startTime
mixed $sql

Returns

mixed —

runStructureTool()

runStructureTool(string  $type, string  $table = null) : string|bool

runStructureTool

Parameters

string $type
string $table

Returns

string|bool —

getQueryForDriver()

getQueryForDriver(mixed  $query) : string

getQuery

Parameters

mixed $query

Returns

string —

sqliteColParser()

sqliteColParser(mixed  $columns) : array

sqliteColParser

Parameters

mixed $columns

Returns

array —

mysqlColParser()

mysqlColParser(mixed  $columns) : array

mysqlColParser

Parameters

mixed $columns

Returns

array —