ThinkPHP5


think\db\Builder
library\think\db\Builder.php at line 20

Class Builder

Builder
All Known Subclasses:
think\db\builder\Mysql think\db\builder\Pgsql think\db\builder\Sqlite think\db\builder\Sqlsrv

public abstract class Builder


Constructor Summary
void

__construct(Connection connection)

架构函数

Method Summary
void

setQuery(Query query)

设置当前的Query对象实例

protected string

parseSqlTable(string sql)

将SQL语句中的__TABLE_NAME__字符串替换成带前缀的表名(小写)

protected array

parseData(array data, array options)

数据分析

protected string

parseKey(string key, array options)

字段名分析

protected string|array

parseValue(mixed value, string field)

value分析

protected string

parseField(mixed fields, array options)

field分析

protected string

parseTable(mixed tables, array options)

table分析

protected string

parseWhere(mixed where, array options)

where分析

string

buildWhere(mixed where, array options)

生成查询条件SQL

protected void

parseWhereItem(mixed field, mixed val, str rule, mixed options, mixed binds, mixed bindName)

protected void

parseClosure(mixed call, bool show)

protected string

parseDateTime(string value, string key, array options, string bindName, integer bindType)

日期时间条件解析

protected string

parseLimit(mixed lmit, mixed limit)

limit分析

protected string

parseJoin(array join, array options)

join分析

protected string

parseOrder(mixed order, array options)

order分析

protected string

parseGroup(mixed group)

group分析

protected string

parseHaving(string having)

having分析

protected string

parseComment(string comment)

comment分析

protected string

parseDistinct(mixed distinct)

distinct分析

protected string

parseUnion(mixed union)

union分析

protected string

parseForce(mixed index)

index分析,可在操作链中指定需要强制使用的索引

protected string

parseLock(bool locl, bool lock)

设置锁机制

string

select(array options)

生成查询SQL

string

insert(array data, array options, bool replace)

生成insert SQL

string

insertAll(array dataSet, array options)

生成insertall SQL

string

selectInsert(array fields, string table, array options)

生成slectinsert SQL

string

update(array fields, array options, mixed data)

生成update SQL

string

delete(array options)

生成delete SQL

Constructor Detail

library\think\db\Builder.php at line 42

__construct

public void __construct(Connection connection)

架构函数

Parameters:
connection - 数据库连接对象实例

Method Detail

library\think\db\Builder.php at line 53

setQuery

public void setQuery(Query query)

设置当前的Query对象实例

Parameters:
query - 当前查询对象实例

library\think\db\Builder.php at line 64

parseSqlTable

protected string parseSqlTable(string sql)

将SQL语句中的__TABLE_NAME__字符串替换成带前缀的表名(小写)

Parameters:
sql - sql语句

library\think\db\Builder.php at line 76

parseData

protected array parseData(array data, array options)

数据分析

Parameters:
data - 数据
options - 查询参数

library\think\db\Builder.php at line 121

parseKey

protected string parseKey(string key, array options)

字段名分析


library\think\db\Builder.php at line 133

parseValue

protected string|array parseValue(mixed value, string field)

value分析


library\think\db\Builder.php at line 154

parseField

protected string parseField(mixed fields, array options)

field分析


library\think\db\Builder.php at line 180

parseTable

protected string parseTable(mixed tables, array options)

table分析


library\think\db\Builder.php at line 206

parseWhere

protected string parseWhere(mixed where, array options)

where分析

Parameters:
where - 查询条件
options - 查询参数

library\think\db\Builder.php at line 219

buildWhere

public string buildWhere(mixed where, array options)

生成查询条件SQL


library\think\db\Builder.php at line 268

parseWhereItem

protected void parseWhereItem(mixed field, mixed val, str rule, mixed options, mixed binds, mixed bindName)

library\think\db\Builder.php at line 380

parseClosure

protected void parseClosure(mixed call, bool show)

library\think\db\Builder.php at line 397

parseDateTime

protected string parseDateTime(string value, string key, array options, string bindName, integer bindType)

日期时间条件解析


library\think\db\Builder.php at line 425

parseLimit

protected string parseLimit(mixed lmit, mixed limit)

limit分析


library\think\db\Builder.php at line 437

parseJoin

protected string parseJoin(array join, array options)

join分析

Parameters:
options - 查询条件

library\think\db\Builder.php at line 467

parseOrder

protected string parseOrder(mixed order, array options)

order分析

Parameters:
options - 查询条件

library\think\db\Builder.php at line 494

parseGroup

protected string parseGroup(mixed group)

group分析


library\think\db\Builder.php at line 505

parseHaving

protected string parseHaving(string having)

having分析


library\think\db\Builder.php at line 516

parseComment

protected string parseComment(string comment)

comment分析


library\think\db\Builder.php at line 527

parseDistinct

protected string parseDistinct(mixed distinct)

distinct分析


library\think\db\Builder.php at line 538

parseUnion

protected string parseUnion(mixed union)

union分析


library\think\db\Builder.php at line 561

parseForce

protected string parseForce(mixed index)

index分析,可在操作链中指定需要强制使用的索引


library\think\db\Builder.php at line 580

parseLock

protected string parseLock(bool locl, bool lock)

设置锁机制


library\think\db\Builder.php at line 591

select

public string select(array options)

生成查询SQL

Parameters:
options - 表达式

library\think\db\Builder.php at line 621

insert

public string insert(array data, array options, bool replace)

生成insert SQL

Parameters:
data - 数据
options - 表达式
replace - 是否replace

library\think\db\Builder.php at line 651

insertAll

public string insertAll(array dataSet, array options)

生成insertall SQL

Parameters:
dataSet - 数据集
options - 表达式

library\think\db\Builder.php at line 698

selectInsert

public string selectInsert(array fields, string table, array options)

生成slectinsert SQL

Parameters:
fields - 数据
table - 数据表
options - 表达式

library\think\db\Builder.php at line 716

update

public string update(array fields, array options, mixed data)

生成update SQL

Parameters:
fields - 数据
options - 表达式

library\think\db\Builder.php at line 749

delete

public string delete(array options)

生成delete SQL

Parameters:
options - 表达式

ThinkPHP5