X-Git-Url: https://git.cweiske.de/grauphel.git/blobdiff_plain/600e904f35d598a64be0139d39b87a59ed5eaa12..6c8ad60e9888fa5625dad2460ca073f93ac1ae0d:/lib/notestorage.php diff --git a/lib/notestorage.php b/lib/notestorage.php index c665903..fb68030 100644 --- a/lib/notestorage.php +++ b/lib/notestorage.php @@ -189,6 +189,22 @@ class NoteStorage \OC_DB::executeAudited($sql, $params); } + /** + * Delete synchronization data for the given user. + * + * @param SyncData $syncdata Synchronization data object + * + * @return void + */ + public function deleteSyncData() + { + \OC_DB::executeAudited( + 'DELETE FROM `*PREFIX*grauphel_syncdata`' + . ' WHERE `syncdata_user` = ?', + array($this->username) + ); + } + /** * Load a note from the storage. * @@ -280,6 +296,20 @@ class NoteStorage ); } + /** + * Delete all notes from storage. + * + * @return void + */ + public function deleteAll() + { + \OC_DB::executeAudited( + 'DELETE FROM `*PREFIX*grauphel_notes`' + . ' WHERE `note_user` = ?', + array($this->username) + ); + } + /** * Load notes for the given user in short form. * Optionally only those changed after $since revision