user = $user; } public function getUser() { if ($this->user) { return $this->user; } elseif ($this->userId) { $this->user = User::findOne(['id' => $this->userId]); return $this->user; } else { return null; } } public function setUserId($userId) { $this->userId = $userId; } public function getUserId() { if ($this->userId) { return $this->userId; } elseif ($this->user) { return $this->user->id; } else { return 0; } } public function setBeforeParentId($beforeParentId) { $this->beforeParentId = $beforeParentId; } public function getBeforeParentId() { if ($this->beforeParentId) { return $this->beforeParentId; } elseif ($this->beforeParent) { return $this->beforeParent->user_id; } else { return 0; } } public function setBeforeParent($beforeParent) { $this->beforeParent = $beforeParent; } public function getBeforeParent() { if ($this->beforeParent) { return $this->beforeParent; } elseif ($this->beforeParentId) { $this->beforeParent = Share::findOne(['user_id' => $this->beforeParentId]); return $this->beforeParent; } else { return null; } } public function setParent($parent) { $this->parent = $parent; } public function getParent() { if ($this->parent) { return $this->parent; } elseif ($this->parentId) { $this->parent = Share::findOne(['user_id' => $this->parentId]); return $this->parent; } else { return null; } } public function setParentId($parentId) { $this->parentId = $parentId; } public function getParentId() { if ($this->parentId) { return $this->parentId; } elseif ($this->parent) { return $this->parent->user_id; } else { return 0; } } public function setRemark($remark) { $this->remark = $remark; } public function getRemark() { if ($this->remark) { return $this->remark; } else { return null; } } }