1
0
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:
Alexander Skvortsov
2021-02-04 10:56:10 -05:00
committed by GitHub
parent 17f15e36eb
commit 8366ec720e
6 changed files with 236 additions and 14 deletions

View File

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