From 6c8ad60e9888fa5625dad2460ca073f93ac1ae0d Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Tue, 14 Oct 2014 23:24:40 +0200 Subject: Add database management page --- lib/notestorage.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'lib') 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 -- cgit v1.2.3