Properties

$className

$className : string

Type

string — 类名

$

$ : string

sql 最终生成的SQL语句

Type

string

$option

$option : 

Type

$method

$method : 

Type

$table

$table : 

Type

$data

$data : 

Type

$columns

$columns : 

Type

$where

$where : 

Type

$join

$join : 

Type

$orderBy

$orderBy : 

Type

$groupBy

$groupBy : 

Type

$having

$having : 

Type

$index

$index : 

Type

$_sql

$_sql : 

Type

$methodKeyword

$methodKeyword : 

Type

$selectFunctionKeyword

$selectFunctionKeyword : 

Type

$otherKeyword

$otherKeyword : 

Type

$db

$db : null

Type

null — 数据库连接实例

$dbclass

$dbclass : null|string

Type

null|string — 数据库类型名称

Methods

init()

init() 

__construct()

__construct(object  $db = null) 

Parameters

object $db

__call()

__call(  $callName,   $argu) : \SQL__Global|mixed

Parameters

$callName
$argu

Throws

\Exception

Returns

\SQL__Global|mixed

__get()

__get(  $getName) 

Parameters

$getName

__set()

__set(  $name,   $value) 

Parameters

$name
$value

Throws

\Exception

_sqlPush()

_sqlPush(  $sql) 

If we use $this->$getName directly, PHP will throw [Indirect modification of overloaded property] So we have to wrap it.

It maybe a bug of PHP.

Parameters

$sql

reset()

reset() : \SQL__Global

Re-initialize this class.

Returns

\SQL__Global

option()

option(  $option) : \SQL__Global

Set SQL query option.

Parameters

$option

Returns

\SQL__Global

column()

column(  $columns) : \SQL__Global

Set column for query.

Parameters

$columns

Returns

\SQL__Global

limit()

limit() : \SQL__Global

Set limit & offset.

Returns

\SQL__Global

Examples

** File not found : limit(5) **
)
** File not found : limit(10, **
))
** File not found : limit(array(10, **

where()

where() : \SQL__Global

Set where query.

Returns

\SQL__Global

Examples

'a', 'b'), array('=', 'a', 'b'))
** File not found : array(array('=', **
'a', 'b'))
** File not found : array(array('=', **
'a', 'b'), array('=', 'a', 'b')
** File not found : array('=', **
'a', 'b')
** File not found : array('=', **

having()

having(  $having) : \SQL__Global

Set having.

Parameters

$having

Returns

\SQL__Global

groupBy()

groupBy(  $groupBy) : \SQL__Global

GroupBy.

Parameters

$groupBy

Returns

\SQL__Global

orderBy()

orderBy() : \SQL__Global

Order by.

Returns

\SQL__Global

data()

data() : \SQL__Global

Set data for INSERT & UPDATE.

Returns

\SQL__Global

Examples

=> 'value', 'key2' => 'value2')
** File not found : array('key' **

exist()

exist(string  $table, string  $dbname = '') : \SQL__Global

Parameters

string $table
string $dbname

Returns

\SQL__Global

query()

query(  $sql = null) 

Parameters

$sql

select()

select(mixed  $a, mixed  $b = null, mixed  $c = null, mixed  $d = null, mixed  $e = null) : \SQL__Global

Parameters

mixed $a
mixed $b
mixed $c
mixed $d
mixed $e

Returns

\SQL__Global

insert()

insert(mixed  $a, mixed  $b = null, mixed  $c = null, mixed  $d = null, mixed  $e = null) : \SQL__Global

Parameters

mixed $a
mixed $b
mixed $c
mixed $d
mixed $e

Returns

\SQL__Global

update()

update(mixed  $a, mixed  $b = null, mixed  $c = null, mixed  $d = null, mixed  $e = null) : \SQL__Global

Parameters

mixed $a
mixed $b
mixed $c
mixed $d
mixed $e

Returns

\SQL__Global

delete()

delete(mixed  $a, mixed  $b = null, mixed  $c = null, mixed  $d = null, mixed  $e = null) : \SQL__Global

Parameters

mixed $a
mixed $b
mixed $c
mixed $d
mixed $e

Returns

\SQL__Global

create()

create(mixed  $a, mixed  $b = null, mixed  $c = null, mixed  $d = null, mixed  $e = null) : \SQL__Global

Parameters

mixed $a
mixed $b
mixed $c
mixed $d
mixed $e

Returns

\SQL__Global

drop()

drop(mixed  $a, mixed  $b = null, mixed  $c = null, mixed  $d = null, mixed  $e = null) : \SQL__Global

Parameters

mixed $a
mixed $b
mixed $c
mixed $d
mixed $e

Returns

\SQL__Global

count()

count(mixed  $a, mixed  $b = null, mixed  $c = null, mixed  $d = null, mixed  $e = null) : \SQL__Global

Parameters

mixed $a
mixed $b
mixed $c
mixed $d
mixed $e

Returns

\SQL__Global

min()

min(mixed  $a, mixed  $b = null, mixed  $c = null, mixed  $d = null, mixed  $e = null) : \SQL__Global

Parameters

mixed $a
mixed $b
mixed $c
mixed $d
mixed $e

Returns

\SQL__Global

max()

max(mixed  $a, mixed  $b = null, mixed  $c = null, mixed  $d = null, mixed  $e = null) : \SQL__Global

Parameters

mixed $a
mixed $b
mixed $c
mixed $d
mixed $e

Returns

\SQL__Global

sum()

sum(mixed  $a, mixed  $b = null, mixed  $c = null, mixed  $d = null, mixed  $e = null) : \SQL__Global

Parameters

mixed $a
mixed $b
mixed $c
mixed $d
mixed $e

Returns

\SQL__Global

columnLoaderArray()

columnLoaderArray(  $columns) 

Parameters

$columns

buildTable()

buildTable() 

buildColumn()

buildColumn() 

buildWhere()

buildWhere(  $originalWhere = null,   $whereKeyword = null) 

Parameters

$originalWhere
$whereKeyword

buildWhere_Single()

buildWhere_Single(  $value) 

Parameters

$value

buildOrderBy()

buildOrderBy() 

buildJoin()

buildJoin() 

buildGroupBy()

buildGroupBy() 

buildHaving()

buildHaving() 

buildLimit()

buildLimit() 

buildPagebar()

buildPagebar() 

buildBeforeWhere()

buildBeforeWhere() 

buildOthers()

buildOthers() 

buildSelect()

buildSelect() 

buildUpdate()

buildUpdate() 

buildDelete()

buildDelete() 

buildInsert()

buildInsert() 

buildDrop()

buildDrop() 

buildCreate()

buildCreate() 

buildIndex()

buildIndex() 

validateParamater()

validateParamater(  $param) 

Parameters

$param

sql()

sql()