mirror of
https://github.com/flarum/core.git
synced 2025-10-18 10:16:09 +02:00
Deprecate GetModelIsPrivate, replace with extender (#2587)
This commit is contained in:
committed by
GitHub
parent
17f15e36eb
commit
8366ec720e
@@ -12,7 +12,6 @@ namespace Flarum\Post;
|
||||
use Flarum\Database\AbstractModel;
|
||||
use Flarum\Database\ScopeVisibilityTrait;
|
||||
use Flarum\Discussion\Discussion;
|
||||
use Flarum\Event\GetModelIsPrivate;
|
||||
use Flarum\Foundation\EventGeneratorTrait;
|
||||
use Flarum\Notification\Notification;
|
||||
use Flarum\Post\Event\Deleted;
|
||||
@@ -96,12 +95,6 @@ class Post extends AbstractModel
|
||||
$post->discussion->save();
|
||||
});
|
||||
|
||||
static::saving(function (self $post) {
|
||||
$event = new GetModelIsPrivate($post);
|
||||
|
||||
$post->is_private = static::$dispatcher->until($event) === true;
|
||||
});
|
||||
|
||||
static::deleted(function (self $post) {
|
||||
$post->raise(new Deleted($post));
|
||||
|
||||
|
Reference in New Issue
Block a user