PHP 클래스 Think\Db\Builder

파일 보기 프로젝트 열기: top-think/framework 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$connection connection对象实例
$deleteSql
$exp 数据库表达式
$insertAllSql
$insertSql
$query 查询对象实例
$selectSql SQL表达式
$updateSql

공개 메소드들

메소드 설명
__construct ( Connection $connection ) 架构函数
buildWhere ( mixed $where, array $options ) : string 生成查询条件SQL
delete ( array $options ) : string 生成delete SQL
insert ( array $data, array $options = [], boolean $replace = false ) : string 生成insert SQL
insertAll ( array $dataSet, array $options ) : string 生成insertall SQL
select ( array $options = [] ) : string 生成查询SQL
selectInsert ( array $fields, string $table, array $options ) : string 生成slectinsert SQL
setQuery ( Query $query ) : void 设置当前的Query对象实例
update ( $data, array $options ) : string 生成update SQL

보호된 메소드들

메소드 설명
parseClosure ( $call, $show = true ) 执行闭包子查询
parseComment ( string $comment ) : string comment分析
parseData ( array $data, array $options ) : array 数据分析
parseDateTime ( string $value, string $key, array $options = [], string $bindName = null, integer $bindType = null ) : string 日期时间条件解析
parseDistinct ( mixed $distinct ) : string distinct分析
parseField ( mixed $fields, array $options = [] ) : string field分析
parseForce ( mixed $index ) : string index分析,可在操作链中指定需要强制使用的索引
parseGroup ( mixed $group ) : string group分析
parseHaving ( string $having ) : string having分析
parseJoin ( array $join, array $options = [] ) : string join分析
parseKey ( string $key, array $options = [] ) : string 字段名分析
parseLimit ( $limit ) : string limit分析
parseLock ( $lock = false ) : string 设置锁机制
parseOrder ( mixed $order, array $options = [] ) : string order分析
parseSqlTable ( string $sql ) : string 将SQL语句中的__TABLE_NAME__字符串替换成带前缀的表名(小写)
parseTable ( mixed $tables, array $options = [] ) : string table分析
parseUnion ( mixed $union ) : string union分析
parseValue ( mixed $value, string $field = '' ) : string | array value分析
parseWhere ( mixed $where, array $options ) : string where分析
parseWhereItem ( $field, $val, $rule = '', $options = [], $binds = [], $bindName = null ) where子单元分析

메소드 상세

__construct() 공개 메소드

架构函数
public __construct ( Connection $connection )
$connection Connection 数据库连接对象实例

buildWhere() 공개 메소드

生成查询条件SQL
public buildWhere ( mixed $where, array $options ) : string
$where mixed
$options array
리턴 string

delete() 공개 메소드

生成delete SQL
public delete ( array $options ) : string
$options array 表达式
리턴 string

insert() 공개 메소드

生成insert SQL
public insert ( array $data, array $options = [], boolean $replace = false ) : string
$data array 数据
$options array 表达式
$replace boolean 是否replace
리턴 string

insertAll() 공개 메소드

生成insertall SQL
public insertAll ( array $dataSet, array $options ) : string
$dataSet array 数据集
$options array 表达式
리턴 string

parseClosure() 보호된 메소드

执行闭包子查询
protected parseClosure ( $call, $show = true )

parseComment() 보호된 메소드

comment分析
protected parseComment ( string $comment ) : string
$comment string
리턴 string

parseData() 보호된 메소드

数据分析
protected parseData ( array $data, array $options ) : array
$data array 数据
$options array 查询参数
리턴 array

parseDateTime() 보호된 메소드

日期时间条件解析
protected parseDateTime ( string $value, string $key, array $options = [], string $bindName = null, integer $bindType = null ) : string
$value string
$key string
$options array
$bindName string
$bindType integer
리턴 string

parseDistinct() 보호된 메소드

distinct分析
protected parseDistinct ( mixed $distinct ) : string
$distinct mixed
리턴 string

parseField() 보호된 메소드

field分析
protected parseField ( mixed $fields, array $options = [] ) : string
$fields mixed
$options array
리턴 string

parseForce() 보호된 메소드

index分析,可在操作链中指定需要强制使用的索引
protected parseForce ( mixed $index ) : string
$index mixed
리턴 string

parseGroup() 보호된 메소드

group分析
protected parseGroup ( mixed $group ) : string
$group mixed
리턴 string

parseHaving() 보호된 메소드

having分析
protected parseHaving ( string $having ) : string
$having string
리턴 string

parseJoin() 보호된 메소드

join分析
protected parseJoin ( array $join, array $options = [] ) : string
$join array
$options array 查询条件
리턴 string

parseKey() 보호된 메소드

字段名分析
protected parseKey ( string $key, array $options = [] ) : string
$key string
$options array
리턴 string

parseLimit() 보호된 메소드

limit分析
protected parseLimit ( $limit ) : string
리턴 string

parseLock() 보호된 메소드

设置锁机制
protected parseLock ( $lock = false ) : string
리턴 string

parseOrder() 보호된 메소드

order分析
protected parseOrder ( mixed $order, array $options = [] ) : string
$order mixed
$options array 查询条件
리턴 string

parseSqlTable() 보호된 메소드

将SQL语句中的__TABLE_NAME__字符串替换成带前缀的表名(小写)
protected parseSqlTable ( string $sql ) : string
$sql string sql语句
리턴 string

parseTable() 보호된 메소드

table分析
protected parseTable ( mixed $tables, array $options = [] ) : string
$tables mixed
$options array
리턴 string

parseUnion() 보호된 메소드

union分析
protected parseUnion ( mixed $union ) : string
$union mixed
리턴 string

parseValue() 보호된 메소드

value分析
protected parseValue ( mixed $value, string $field = '' ) : string | array
$value mixed
$field string
리턴 string | array

parseWhere() 보호된 메소드

where分析
protected parseWhere ( mixed $where, array $options ) : string
$where mixed 查询条件
$options array 查询参数
리턴 string

parseWhereItem() 보호된 메소드

where子单元分析
protected parseWhereItem ( $field, $val, $rule = '', $options = [], $binds = [], $bindName = null )

select() 공개 메소드

生成查询SQL
public select ( array $options = [] ) : string
$options array 表达式
리턴 string

selectInsert() 공개 메소드

生成slectinsert SQL
public selectInsert ( array $fields, string $table, array $options ) : string
$fields array 数据
$table string 数据表
$options array 表达式
리턴 string

setQuery() 공개 메소드

设置当前的Query对象实例
public setQuery ( Query $query ) : void
$query Query 当前查询对象实例
리턴 void

update() 공개 메소드

生成update SQL
public update ( $data, array $options ) : string
$options array 表达式
리턴 string

프로퍼티 상세

$connection 보호되어 있는 프로퍼티

connection对象实例
protected $connection

$deleteSql 보호되어 있는 프로퍼티

protected $deleteSql

$exp 보호되어 있는 프로퍼티

数据库表达式
protected $exp

$insertAllSql 보호되어 있는 프로퍼티

protected $insertAllSql

$insertSql 보호되어 있는 프로퍼티

protected $insertSql

$query 보호되어 있는 프로퍼티

查询对象实例
protected $query

$selectSql 보호되어 있는 프로퍼티

SQL表达式
protected $selectSql

$updateSql 보호되어 있는 프로퍼티

protected $updateSql