本文整理匯總了PHP中app\models\Log::logModerateForumTopicMove方法的典型用法代碼示例。如果您正苦於以下問題:PHP Log::logModerateForumTopicMove方法的具體用法?PHP Log::logModerateForumTopicMove怎麽用?PHP Log::logModerateForumTopicMove使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類app\models\Log
的用法示例。
在下文中一共展示了Log::logModerateForumTopicMove方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: moveTo
public function moveTo($destinationForum)
{
if ($this->forum_id === $destinationForum->forum_id) {
return true;
}
if (!$this->forum->isOpen()) {
return false;
}
return DB::transaction(function () use($destinationForum) {
$originForum = $this->forum;
$this->forum()->associate($destinationForum);
$this->save();
$this->posts()->update(['forum_id' => $destinationForum->forum_id]);
$this->logs()->update(['forum_id' => $destinationForum->forum_id]);
$this->userTracks()->update(['forum_id' => $destinationForum->forum_id]);
if ($originForum !== null) {
$originForum->refreshCache();
}
if ($this->forum !== null) {
$this->forum->refreshCache();
}
$users = User::whereIn('user_id', model_pluck($this->posts(), 'poster_id'))->get();
foreach ($users as $user) {
$user->refreshForumCache();
}
Log::logModerateForumTopicMove($this, $originForum);
return true;
});
}