diff --git a/src/Discussion/Discussion.php b/src/Discussion/Discussion.php index 5d2ecb6ed..2b6f27bb2 100644 --- a/src/Discussion/Discussion.php +++ b/src/Discussion/Discussion.php @@ -110,6 +110,10 @@ class Discussion extends AbstractModel Notification::whereSubject($discussion)->delete(); }); + /** + * @deprecated beta 15, remove beta 16 + * When needed, the `Flarum\Discussion\Event\Saving` event should be listened to directly. + */ static::saving(function (self $discussion) { $event = new GetModelIsPrivate($discussion); diff --git a/src/Event/GetModelIsPrivate.php b/src/Event/GetModelIsPrivate.php index ffb572b9c..2b6d206b4 100644 --- a/src/Event/GetModelIsPrivate.php +++ b/src/Event/GetModelIsPrivate.php @@ -13,6 +13,9 @@ use Flarum\Database\AbstractModel; /** * Determine whether or not a model should be marked as `is_private`. + * + * @deprecated beta 15, remove beta 16 + * When needed, the `Flarum\Discussion\Event\Saving` event should be listened to directly. */ class GetModelIsPrivate { diff --git a/src/Post/Post.php b/src/Post/Post.php index fc9ef843b..ccbd3fb05 100644 --- a/src/Post/Post.php +++ b/src/Post/Post.php @@ -96,6 +96,10 @@ class Post extends AbstractModel $post->discussion->save(); }); + /** + * @deprecated beta 15, remove beta 16 + * When needed, the `Flarum\Discussion\Event\Saving` event should be listened to directly. + */ static::saving(function (self $post) { $event = new GetModelIsPrivate($post);