Remove related notifications when marking an item for deletion

This commit is contained in:
Hypolite Petovan 2022-11-26 21:48:26 -05:00
parent a95e93c725
commit 25e1412174
3 changed files with 29 additions and 0 deletions

View file

@ -807,4 +807,10 @@ class Notify extends BaseRepository
return $this->storeAndSend($params, $sitelink, $tsitelink, $hsitelink, $title, $subject, $preamble, $epreamble, $item['body'], $itemlink, true);
}
public function deleteForItem(int $itemUriId): void
{
$this->db->delete('notify', ['otype' => 'item', 'uri-id' => $itemUriId]);
$this->db->delete('notify', ['otype' => 'item', 'parent-uri-id' => $itemUriId]);
}
}