1
0
mirror of https://github.com/flarum/core.git synced 2025-08-05 16:07:34 +02:00

Deprecate GetModelIsPrivate and its usages

This commit is contained in:
Alexander Skvortsov
2020-11-22 01:26:52 -05:00
parent 9cb9097b24
commit fb0484e242
3 changed files with 11 additions and 0 deletions

View File

@@ -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);

View File

@@ -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
{

View File

@@ -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);