mirror of
https://github.com/flarum/core.git
synced 2025-10-18 18:26:07 +02:00
Deprecate GetModelIsPrivate, replace with extender (#2587)
This commit is contained in:
committed by
GitHub
parent
17f15e36eb
commit
8366ec720e
@@ -17,7 +17,6 @@ use Flarum\Discussion\Event\Hidden;
|
||||
use Flarum\Discussion\Event\Renamed;
|
||||
use Flarum\Discussion\Event\Restored;
|
||||
use Flarum\Discussion\Event\Started;
|
||||
use Flarum\Event\GetModelIsPrivate;
|
||||
use Flarum\Foundation\EventGeneratorTrait;
|
||||
use Flarum\Notification\Notification;
|
||||
use Flarum\Post\MergeableInterface;
|
||||
@@ -109,12 +108,6 @@ class Discussion extends AbstractModel
|
||||
|
||||
Notification::whereSubject($discussion)->delete();
|
||||
});
|
||||
|
||||
static::saving(function (self $discussion) {
|
||||
$event = new GetModelIsPrivate($discussion);
|
||||
|
||||
$discussion->is_private = static::$dispatcher->until($event) === true;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user