mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 23:02:48 +08:00
改进关联
This commit is contained in:
@@ -184,7 +184,7 @@ class BelongsTo extends OneToOne
|
|||||||
$this->parent->setAttr($foreignKey, $model->$pk);
|
$this->parent->setAttr($foreignKey, $model->$pk);
|
||||||
$this->parent->save();
|
$this->parent->save();
|
||||||
|
|
||||||
return $this->parent->setAttr($this->relation, $model);
|
return $this->parent->data($this->relation, $model);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -199,6 +199,6 @@ class BelongsTo extends OneToOne
|
|||||||
$this->parent->setAttr($foreignKey, null);
|
$this->parent->setAttr($foreignKey, null);
|
||||||
$this->parent->save();
|
$this->parent->save();
|
||||||
|
|
||||||
return $this->parent->setAttr($this->relation, null);
|
return $this->parent->data($this->relation, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -241,7 +241,7 @@ class MorphTo extends Relation
|
|||||||
$this->parent->setAttr($morphType, get_class($model));
|
$this->parent->setAttr($morphType, get_class($model));
|
||||||
$this->parent->save();
|
$this->parent->save();
|
||||||
|
|
||||||
return $this->parent->setAttr($this->relation, $model);
|
return $this->parent->data($this->relation, $model);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -258,7 +258,7 @@ class MorphTo extends Relation
|
|||||||
$this->parent->setAttr($morphType, null);
|
$this->parent->setAttr($morphType, null);
|
||||||
$this->parent->save();
|
$this->parent->save();
|
||||||
|
|
||||||
return $this->parent->setAttr($this->relation, null);
|
return $this->parent->data($this->relation, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user