aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2014-10-14 23:24:40 +0200
committerChristian Weiske <cweiske@cweiske.de>2014-10-14 23:24:40 +0200
commit6c8ad60e9888fa5625dad2460ca073f93ac1ae0d (patch)
treeb68bddc4eed7071b62ca3c88e5820b9247290079 /lib
parent2cb2fae10d986db73bb0ad517df8c5334cab713c (diff)
downloadgrauphel-6c8ad60e9888fa5625dad2460ca073f93ac1ae0d.tar.gz
grauphel-6c8ad60e9888fa5625dad2460ca073f93ac1ae0d.zip
Add database management page
Diffstat (limited to 'lib')
-rw-r--r--lib/notestorage.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/notestorage.php b/lib/notestorage.php
index c665903..fb68030 100644
--- a/lib/notestorage.php
+++ b/lib/notestorage.php
@@ -190,6 +190,22 @@ class NoteStorage
}
/**
+ * 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.
*
* @param string $guid Note identifier
@@ -281,6 +297,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
*