\SQL_Where

SQL_Where

SQLヘルパのWhereメソッド群です。
メソッドの外で,条件対象のテーブルが選択されている必要があります

Summary

Methods
Properties
Constants
__construct()
isClass()
newSeq()
optimizeSeq()
nextval()
currval()
setval()
newField()
newFunction()
newGeometry()
newOpr()
newOprIn()
newOprNotIn()
newOprExists()
newOprNotExists()
newOprBw()
newCase()
newWhere()
newSelect()
newInsert()
newReplace()
newUpdate()
newInsertOrUpdate()
newDelete()
delete()
addWhere()
setWhere()
getWhereOpr()
getWhereIn()
getWhereNotIn()
getWhereExists()
getWhereNotExists()
getWhereBw()
addWhereOpr()
addWhereIn()
addWhereNotIn()
addWhereExists()
addWhereNotExists()
addWhereBw()
where()
get()
$_wheres
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$_wheres

$_wheres : 

Type

Methods

__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

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