diff --git a/framework/core/src/Core/Models/Discussion.php b/framework/core/src/Core/Models/Discussion.php index 4211e755c..d3c26e2d9 100755 --- a/framework/core/src/Core/Models/Discussion.php +++ b/framework/core/src/Core/Models/Discussion.php @@ -49,6 +49,13 @@ class Discussion extends Model */ public $addedPosts = []; + /** + * An array of posts that have been removed during this request. + * + * @var \Flarum\Core\Models\Post[] + */ + public $removedPosts = []; + /** * The user for which the state relationship should be loaded. * @@ -166,6 +173,18 @@ class Discussion extends Model $this->addedPosts[] = $post; } + /** + * Specify that a post was removed from this discussion during this + * request for later retrieval. + * + * @param \Flarum\Core\Models\Post $post + * @return void + */ + public function postWasRemoved(Post $post) + { + $this->removedPosts[] = $post->id; + } + /** * Define the relationship with the discussion's posts. *