beginTransaction(); $result = parent::deleteAll($messageIDs); if ($messageIDs !== []) { AttachmentHandler::removeAttachments('be.bastelstu.chat.message', $messageIDs); } WCF::getDB()->commitTransaction(); return $result; } }