thinkphp源码无差别阅读(二十九)

ORM阅读
db/Where.plhp
- 属性:where、enclose
 - 构造方法:__construct
 - 设置是否添加括号:enclose
 - 解析query对象为数组:parse
 - 分析查询表达式:parseItem
 - 修改器:__set
 - 获取器:__get
 - 检测数组对象的值:__isset
 - 销毁:__unset
 - 数组式访问:offsetSet、offsetExists、offsetUnset、offsetGet
 
facade/Db.php
- 获取当前facade对应的类名:getFacadeClass
 
model/Collection.php
- 延迟预载于关联查询:load
 - 删除:delete
 - 更新:update
 - 设置隐藏:hidden
 - 设置显示:visible
 - 设置需要追加的属性:append
 - 设置模型输出场景:scene
 - 设置父模型:setParent
 - 设置获取器:withAttr
 - 关联属性到当前模型:bindAttr
 - 按指定键整理数据:dictionary
 - 差集:diff
 - 交集:intersect
 
model/Pivot.php
- 属性:parent、autoWriteTimestamp
 - 构造方法:__construct
 
model/Relation.php
- 属性:parent、model、query、foreignKey、localKey、baseQuery、selfRelation、withLimit、withField、withoutField、default
 - 获取关联模型:getParent
 - 获取query:getQuery
 - 获取外键:getForeignKey
 - 获取主键:getLocalKey
 - 获取当前模型:getModel
 - 是否自关联:isSelfRelation
 - 封装关联数据集:resultSetBuild
 - 获取查询字段:getQueryFields
 - 获取查询字段:getRelationQueryFields
 - 获取查询条件:getQueryWhere
 - 限制关联数量:withLimit
 - 限制关联字段:withField
 - 排除关联字段:withoutField
 - 设置关联数据不存在时的默认:withDefault
 - 获取关联数据默认值:getDefaultModel
 - 判断闭包的参数类型:getClosureType
 - 执行基础查询:baseQuery
 - 动态调用:__call
 
计划阅读
[ ] framework源码
 [ ] orm源码
 [ ] helper源码











