\think\modelRelation

Class Relation

Summary

Methods
Properties
Constants
getParent()
getModel()
getQuery()
__call()
No public properties found
No constants found
resultSetBuild()
getQueryFields()
getRelationQueryFields()
baseQuery()
$parent
$model
$query
$foreignKey
$localKey
$baseQuery
N/A
No private methods found
No private properties found
N/A

Properties

$parent

$parent : 

Type

$model

$model : \think\Model

Type

\think\Model — 当前关联的模型类

$query

$query : \think\db\Query

Type

\think\db\Query — 关联模型查询对象

$foreignKey

$foreignKey : 

Type

$localKey

$localKey : 

Type

$baseQuery

$baseQuery : 

Type

Methods

getParent()

getParent() : \think\Model

获取关联的所属模型

Returns

\think\Model

getModel()

getModel() : string

获取当前的关联模型类

Returns

string

getQuery()

getQuery() : \think\db\Query

获取关联的查询对象

Returns

\think\db\Query

__call()

__call(  $method,   $args) 

Parameters

$method
$args

resultSetBuild()

resultSetBuild(array  $resultSet) : mixed

封装关联数据集

Parameters

array $resultSet

数据集

Returns

mixed

getQueryFields()

getQueryFields(  $model) 

Parameters

$model

getRelationQueryFields()

getRelationQueryFields(  $fields,   $model) 

Parameters

$fields
$model

baseQuery()

baseQuery() : void

执行基础查询(仅执行一次)