Properties

$_wheres

$_wheres : 

Type

$_tables

$_tables : 

Type

$_leftJoins

$_leftJoins : 

Type

$_innerJoins

$_innerJoins : 

Type

$_selects

$_selects : 

Type

$_havings

$_havings : 

Type

$_groups

$_groups : 

Type

$_limit

$_limit : 

Type

$_orders

$_orders : 

Type

$_fdOrders

$_fdOrders : 

Type

$_where

$_where : 

Type

$_union

$_union : 

Type

$_straightJoin

$_straightJoin : 

Type

Methods

addWhere()

addWhere(  $w,   $gl = 'AND') 

Parameters

$w
$gl

setWhere()

setWhere(  $w,   $gl = 'AND') 

Parameters

$w
$gl

getWhereOpr()

getWhereOpr(  $fd,   $val,   $opr = '=',   $gl = 'AND',   $scp = null,   $func = null) 

Parameters

$fd
$val
$opr
$gl
$scp
$func

getWhereIn()

getWhereIn(  $fd,   $vals,   $gl = 'AND',   $scp = null,   $func = null) 

Parameters

$fd
$vals
$gl
$scp
$func

getWhereNotIn()

getWhereNotIn(  $fd,   $vals,   $gl = 'AND',   $scp = null,   $func = null) 

Parameters

$fd
$vals
$gl
$scp
$func

getWhereExists()

getWhereExists(  $vals,   $gl = 'AND') 

Parameters

$vals
$gl

getWhereNotExists()

getWhereNotExists(  $vals,   $gl = 'AND') 

Parameters

$vals
$gl

getWhereBw()

getWhereBw(  $fd,   $a,   $b,   $gl = 'AND',   $scp = null,   $func = null) 

Parameters

$fd
$a
$b
$gl
$scp
$func

addWhereOpr()

addWhereOpr(string  $fd, string|integer  $val, string  $opr = '=', string  $gl = 'AND', string|null  $scp = null, string|null  $func = null) : boolean

指定されたfieldとvalueからWHERE句を生成する。<br> $SQL->addWhereOpr('entry_id', 10, '=', 'OR', 'entry', 'count');<br> WHERE 0 OR COUNT(entry.entry_id) = 10

Parameters

string $fd
string|integer $val
string $opr
string $gl
string|null $scp
string|null $func

Returns

boolean

addWhereIn()

addWhereIn(string  $fd, array  $vals, string  $gl = 'AND', string|null  $scp = null, string|null  $func = null) : boolean

指定されたfieldとvalue(配列)からIN句を生成する。<br> $SQL->addWhereIn('entry_id', array(10, 20, 30), 'AND', 'entry');<br> WHERE 1 AND entry.entry_id IN (10, 29, 30)

Parameters

string $fd
array $vals
string $gl
string|null $scp
string|null $func

Returns

boolean

addWhereNotIn()

addWhereNotIn(string  $fd, array  $vals, string  $gl = 'AND', string|null  $scp = null, string|null  $func = null) : boolean

指定されたfieldとvalue(配列)からNOT IN句を生成する。<br> $SQL->addWhereNotIn('entry_id', array(10, 20, 30), 'AND', 'entry');<br> WHERE 1 AND entry.entry_id NOT IN (10, 29, 30)

Parameters

string $fd
array $vals
string $gl
string|null $scp
string|null $func

Returns

boolean

addWhereExists()

addWhereExists(array  $vals, string  $gl = 'AND') : boolean

指定されたSQL_SelectオブジェクトからEXISTS句を生成する。<br> $SQL->addWhereExists(SQL_SELECT);<br> WHERE 1 AND EXISTS (SELECT * .

..)

Parameters

array $vals
string $gl

Returns

boolean

addWhereNotExists()

addWhereNotExists(array  $vals, string  $gl = 'AND') : boolean

指定されたSQL_SelectオブジェクトからNOT EXISTS句を生成する。<br> $SQL->addWhereExists(SQL_SELECT);<br> WHERE 1 AND NOT EXISTS (SELECT * .

..)

Parameters

array $vals
string $gl

Returns

boolean

addWhereBw()

addWhereBw(string  $fd, string|integer  $a, string|integer  $b, string  $gl = 'AND', string|null  $scp = null, string|null  $func = null) : boolean

指定されたfieldとvalue(2つ)からBETWEEN句を生成する。<br> $SQL->addWhereOpr('entry_id', 10, 20, 'AND', 'entry');<br> WHERE 1 AND entry.entry_id BETWEEN 100 AND 200

Parameters

string $fd
string|integer $a
string|integer $b
string $gl
string|null $scp
string|null $func

Returns

boolean

where()

where(  $dsn = null) 

Parameters

$dsn

get()

get(  $dsn = null) 

Parameters

$dsn

__construct()

__construct(  $SQL = null) 

Parameters

$SQL

isClass()

isClass(  $obj,   $className) 

Parameters

$obj
$className

newSeq()

newSeq(  $seq,   $method = 'nextval',   $val = null) 

Parameters

$seq
$method
$val

optimizeSeq()

optimizeSeq(string  $seq, null  $dsn = null, boolean  $plugin = false) : integer

指定されたsequence fieldのシーケンス番号を最適化する<br> SQL::optimizeSeq('entry_id', dsn())<br> UPDATE acms_sequence SET sequence_entry_id = ( LAST_INSERT_ID(sequence_entry_id + 1) )

Parameters

string $seq
null $dsn
boolean $plugin

Returns

integer

nextval()

nextval(string  $seq, null  $dsn = null,   $plugin = false) : integer

指定されたsequence fieldのシーケンス番号を1進めてその値を返す<br> SQL::nextval('entry_id', dsn())<br> UPDATE acms_sequence SET sequence_entry_id = ( LAST_INSERT_ID(sequence_entry_id + 1) )

Parameters

string $seq
null $dsn
$plugin

Returns

integer

currval()

currval(string  $seq, null  $dsn = null,   $plugin = false) : integer

指定されたsequence fieldの現在のシーケンス番号を返す<br> SQL::currval('entry_id', dsn())<br> SELECT sequence_entry_id FROM acms_sequence

Parameters

string $seq
null $dsn
$plugin

Returns

integer

setval()

setval(string  $seq,   $val, null  $dsn = null,   $plugin = false) : integer

指定されたsequence fieldを指定された値にセットする<br> SQL::setval('entry_id', 10, dsn())<br> UPDATE acms_sequence SET sequence_entry_id = 10

Parameters

string $seq
$val
null $dsn
$plugin

Returns

integer

newField()

newField(  $fd,   $scp = null) 

Parameters

$fd
$scp

newFunction()

newFunction(  $fd,   $func = null,   $scp = null) 

Parameters

$fd
$func
$scp

newGeometry()

newGeometry(  $lat,   $lng,   $scp = null) 

Parameters

$lat
$lng
$scp

newOpr()

newOpr(  $fd,   $val = null,   $opr = '=',   $scp = null,   $func = null) 

Parameters

$fd
$val
$opr
$scp
$func

newOprIn()

newOprIn(  $fd,   $val,   $scp = null,   $func = null) 

Parameters

$fd
$val
$scp
$func

newOprNotIn()

newOprNotIn(  $fd,   $val,   $scp = null,   $func = null) 

Parameters

$fd
$val
$scp
$func

newOprExists()

newOprExists(  $val,   $scp = null) 

Parameters

$val
$scp

newOprNotExists()

newOprNotExists(  $val,   $scp = null) 

Parameters

$val
$scp

newOprBw()

newOprBw(  $fd,   $a,   $b,   $scp = null,   $func = null) 

Parameters

$fd
$a
$b
$scp
$func

newCase()

newCase(  $simple = null) 

Parameters

$simple

newWhere()

newWhere() 

newSelect()

newSelect(string|null  $tb = null, string|null  $als = null,   $straight_join = false) : \SQL_Select

TABLEを指定してSELECT句を生成する為のSQL_Selectを返す

Parameters

string|null $tb
string|null $als
$straight_join

Returns

\SQL_Select

newInsert()

newInsert(string|null  $tb = null) : \SQL_Insert

TABLEを指定してINSERT句を生成する為のSQL_Insertを返す

Parameters

string|null $tb

Returns

\SQL_Insert

newReplace()

newReplace(string|null  $tb = null) : \SQL_Replace

TABLEを指定してREPLACE句を生成する為のSQL_Replaceを返す

Parameters

string|null $tb

Returns

\SQL_Replace

newUpdate()

newUpdate(string|null  $tb = null) : \SQL_Update

TABLEを指定してUPDATE句を生成する為のSQL_Updateを返す

Parameters

string|null $tb

Returns

\SQL_Update

newInsertOrUpdate()

newInsertOrUpdate(string|null  $tb = null, string|null  $als = null) : \SQL_Select

TABLEを指定してINSERT ON DUPLICATE KEY UPDATE句を生成する為のSQL_InsertOrUpdateを返す

Parameters

string|null $tb
string|null $als

Returns

\SQL_Select

newDelete()

newDelete(string|null  $tb = null) : \SQL_Delete

TABLEを指定してDELETE句を生成する為のSQL_Deleteを返す

Parameters

string|null $tb

Returns

\SQL_Delete

delete()

delete(  $tb,   $w = null,   $dsn = null) 

Parameters

$tb
$w
$dsn

addTable()

addTable(  $tb,   $als = null,   $straight_join = false) 

Parameters

$tb
$als
$straight_join

setTable()

setTable(  $tb = null,   $als = null,   $straight_join = false) 

Parameters

$tb
$als
$straight_join

addLeftJoin()

addLeftJoin(string  $tb, string|integer  $a, string|integer  $b, string  $aScp = null, string  $bScp = null,   $where = null) : boolean

指定されたtableと条件からtableを結合する。<br> $SQL->addLeftJoin('category', 'category_id', 'entry_category_id', 'category', 'entry');<br> LEFT JOIN acms_category AS category ON category.category_id = entry.entry_category_id

Parameters

string $tb
string|integer $a
string|integer $b
string $aScp
string $bScp
$where

Returns

boolean

setLeftJoin()

setLeftJoin(  $tb = null,   $a = null,   $b = null,   $aScp = null,   $bScp = null,   $where = null) 

Parameters

$tb
$a
$b
$aScp
$bScp
$where

addInnerJoin()

addInnerJoin(string  $tb, string|integer  $a, string|integer  $b, string  $als = null, string  $scp = null,   $where = null) : boolean

指定されたtableと条件からINNER JOIN句を生成する。<br> $SQL->addInnerJoin('category', 'category_id', 'entry_category_id', 'category', 'acms_entry');<br> INNER JOIN acms_category AS category ON category.category_id = entry.entry_category_id

Parameters

string $tb
string|integer $a
string|integer $b
string $als
string $scp
$where

Returns

boolean

setInnerJoin()

setInnerJoin(  $tb = null,   $a = null,   $b = null,   $als = null,   $scp = null) 

Parameters

$tb
$a
$b
$als
$scp

addUnion()

addUnion(  $select) 

Parameters

$select

addSelect()

addSelect(string  $fd, string  $als = null, string  $scp = null, string  $func = null) : boolean

指定されたfieldを追加する。<br> $SQL->addSelect('entry_id', 'entry_count', 'acms_entry', 'count');<br> SELECT COUNT(acms_entry.entry_id) AS entry_count

Parameters

string $fd
string $als
string $scp
string $func

Returns

boolean

setSelect()

setSelect(  $fd = null,   $als = null,   $scp = null,   $func = null) 

Parameters

$fd
$als
$scp
$func

addGeoDistance()

addGeoDistance(  $fd,   $lat,   $lng,   $als = null,   $scp = null) 

Parameters

$fd
$lat
$lng
$als
$scp

addHaving()

addHaving(string  $h, string  $gl = 'AND') : boolean

指定された条件式でHAVING句を生成する<br> $SQL->addHaving('entry_id > 5', 'AND');<br> HAVING ( 1 AND entry_id > 5 )

Parameters

string $h
string $gl

Returns

boolean

setHaving()

setHaving(  $h = null,   $gl = 'AND') 

Parameters

$h
$gl

addGroup()

addGroup(string  $fd, string  $scp = null) : boolean

指定されたfieldでGROUP BY句を生成する<br> $SQL->addGroup('blog_id', 'acms_blog');<br> GROUP BY acms_blog.blog_id

Parameters

string $fd
string $scp

Returns

boolean

setGroup()

setGroup(  $fd = null,   $scp = null) 

Parameters

$fd
$scp

setLimit()

setLimit(integer  $lmt, integer  $off) : boolean

指定された数のレコードを返す<br> $SQL->setLimit(30, 10);<br> LIMIT 10, 30

Parameters

integer $lmt
integer $off

Returns

boolean

addOrder()

addOrder(  $fd,   $ord = 'ASC',   $scp = null) 

Parameters

$fd
$ord
$scp

setOrder()

setOrder(  $fd = null,   $ord = 'ASC',   $scp = null) : boolean

指定されたorderのSQLを生成する<br> $SQL->setOrder('entry_id', 'ASC', 'acms_entry');<br> LIMIT 10, 30

Parameters

$fd
$ord
$scp

Returns

boolean

setFieldOrder()

setFieldOrder(  $fd = null,   $values = array(),   $scp = null) 

Parameters

$fd
$values
$scp