X-Git-Url: https://git.cweiske.de/grauphel.git/blobdiff_plain/a6e6dc9e303ccddf1cb6e699f5e43295af361e0f..8ee6bfe97633d31c6b89cebbc434837eca04d6dd:/lib/notestorage.php?ds=sidebyside diff --git a/lib/notestorage.php b/lib/notestorage.php index fb68030..7ecf049 100644 --- a/lib/notestorage.php +++ b/lib/notestorage.php @@ -245,6 +245,28 @@ class NoteStorage return $this->noteFromRow($row); } + /** + * 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. *