generateLogResolveChange() public static méthode

public static generateLogResolveChange ( $user, $resolved )
 public function store()
 {
     $discussion = BeatmapDiscussion::findOrNew(Request::input('beatmap_discussion_id'));
     $isNewDiscussion = $discussion->id === null;
     if ($isNewDiscussion) {
         $beatmapsetDiscussion = BeatmapsetDiscussion::where('beatmapset_id', Request::input('beatmapset_id'))->firstOrFail();
         $discussion->beatmapset_discussion_id = $beatmapsetDiscussion->id;
     }
     $posts = [new BeatmapDiscussionPost($this->postParams($discussion))];
     $previousDiscussionResolved = $discussion->resolved;
     $discussion->fill($this->discussionParams($isNewDiscussion));
     priv_check('BeatmapDiscussionPost', $discussion)->ensureCan();
     if ($discussion->resolved === true) {
         priv_check('BeatmapDiscussionResolve', $discussion)->ensureCan();
     }
     if (!$isNewDiscussion && $discussion->resolved !== $previousDiscussionResolved) {
         $posts[] = BeatmapDiscussionPost::generateLogResolveChange(Auth::user(), $discussion->resolved);
     }
     try {
         $saved = DB::transaction(function () use($posts, $discussion) {
             if ($discussion->save() === false) {
                 throw new Exception('failed');
             }
             foreach ($posts as $post) {
                 // done here since discussion may or may not previously exist
                 $post->beatmap_discussion_id = $discussion->id;
                 if ($post->save() === false) {
                     throw new Exception('failed');
                 }
             }
             return true;
         });
     } catch (Exception $_e) {
         $saved = false;
     }
     $postIds = array_pluck($posts, 'id');
     if ($saved === true) {
         return ['beatmapset_discussion' => $posts[0]->beatmapsetDiscussion->defaultJson(Auth::user()), 'beatmap_discussion_post_ids' => $postIds, 'beatmap_discussion_id' => $discussion->id];
     } else {
         return error_popup(trans('beatmaps.discussion-posts.store.error'));
     }
 }