aboutsummaryrefslogtreecommitdiff
path: root/lib/notestorage.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/notestorage.php')
-rw-r--r--lib/notestorage.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/notestorage.php b/lib/notestorage.php
index fb68030..7ecf049 100644
--- a/lib/notestorage.php
+++ b/lib/notestorage.php
@@ -246,6 +246,28 @@ class NoteStorage
}
/**
+ * Load a GUID of a note by the note title
+ *
+ * @param string $title Note title
+ *
+ * @return string GUID, NULL if note could not be found
+ */
+ public function loadGuidByTitle($title)
+ {
+ $row = \OC_DB::executeAudited(
+ 'SELECT note_guid FROM `*PREFIX*grauphel_notes`'
+ . ' WHERE `note_user` = ? AND `note_title` = ?',
+ array($this->username, $title)
+ )->fetchRow();
+
+ if ($row === false) {
+ return null;
+ }
+
+ return $row['note_guid'];
+ }
+
+ /**
* Save a note into storage.
*
* @param object $note Note to save