link($name)
会使用..get$name...即有hasmany和hasone...
// update lazily loaded related objects
if (!$relation->multiple) {
$this->_related[$name] = $model;
} elseif (isset($this->_related[$name])) {
if ($relation->indexBy !== null) {
$indexBy = $relation->indexBy;
$this->_related[$name][$model->$indexBy] = $model;
} else {
$this->_related[$name][] = $model;
}
}
如果是单独模型的画则直接赋值
时间: 2024-11-05 16:05:34