[ENTITY][Note] Add deleter
这个提交包含在:
父节点
b1585f0ef2
当前提交
5f167517ad
@ -360,6 +360,23 @@ class Note extends Entity
|
||||
return $mentioned;
|
||||
}
|
||||
|
||||
public function delete(?int $actor_id = null, string $source = 'web'): bool
|
||||
{
|
||||
if (Event::handle('NoteDeleteRelated', [&$this]) === Event::next) {
|
||||
DB::persist(Activity::create([
|
||||
'actor_id' => $actor_id ?? $this->getActorId(),
|
||||
'verb' => 'delete',
|
||||
'object_type' => 'note',
|
||||
'object_id' => $this->getId(),
|
||||
'source' => $source
|
||||
])
|
||||
);
|
||||
DB::remove($this);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function schemaDef(): array
|
||||
{
|
||||
return [
|
||||
|
正在加载...
x
在新工单中引用
屏蔽一个用户