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