diff options
| author | Christian Weiske <cweiske@cweiske.de> | 2014-10-23 23:07:01 +0200 |
|---|---|---|
| committer | Christian Weiske <cweiske@cweiske.de> | 2014-10-23 23:07:01 +0200 |
| commit | 8ee6bfe97633d31c6b89cebbc434837eca04d6dd (patch) | |
| tree | 3d346e6d6b18e608813924b784ebda1d6520beef /lib/notestorage.php | |
| parent | a6e6dc9e303ccddf1cb6e699f5e43295af361e0f (diff) | |
| download | grauphel-8ee6bfe97633d31c6b89cebbc434837eca04d6dd.tar.gz grauphel-8ee6bfe97633d31c6b89cebbc434837eca04d6dd.zip | |
note preview
Diffstat (limited to 'lib/notestorage.php')
| -rw-r--r-- | lib/notestorage.php | 22 |
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 |
