From 8396e2a40a3df0194f1873ab3118a2a8a16465d5 Mon Sep 17 00:00:00 2001 From: Matias De lellis Date: Wed, 6 Nov 2019 09:25:36 -0300 Subject: [PATCH] Add database tables to tag notes --- appinfo/database.xml | 63 ++++++++++++++++++++++++++++++++++++++++++++ appinfo/info.xml | 2 +- db/notetag.php | 23 ++++++++++++++++ db/notetagmapper.php | 23 ++++++++++++++++ db/tag.php | 21 +++++++++++++++ db/tagmapper.php | 23 ++++++++++++++++ 6 files changed, 154 insertions(+), 1 deletion(-) create mode 100644 db/notetag.php create mode 100644 db/notetagmapper.php create mode 100644 db/tag.php create mode 100644 db/tagmapper.php diff --git a/appinfo/database.xml b/appinfo/database.xml index 99b4165..e9f1c29 100644 --- a/appinfo/database.xml +++ b/appinfo/database.xml @@ -68,6 +68,69 @@ + + *dbprefix*quicknotes_tags + + + id + integer + true + true + true + true + 8 + + + user_id + text + 200 + + true + + + name + text + 200 + + true + + +
+ + *dbprefix*quicknotes_note_tags + + + id + integer + true + true + true + true + 8 + + + user_id + text + 200 + + true + + + note_id + integer + true + true + 8 + + + tag_id + integer + true + true + 8 + + +
*dbprefix*quicknotes_tasks diff --git a/appinfo/info.xml b/appinfo/info.xml index 6dcfbe7..1870be7 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -5,7 +5,7 @@ Quick notes Quick notes with a basic rich text Quick notes with a basic rich text - 0.1.10 + 0.1.11 agpl Matias De lellis QuickNotes diff --git a/db/notetag.php b/db/notetag.php new file mode 100644 index 0000000..dd9374d --- /dev/null +++ b/db/notetag.php @@ -0,0 +1,23 @@ + $this->id, + 'noteid' => $this->noteId, + 'tagid' => $this->tagId, + 'userid' => $this->userId + ]; + } + +} \ No newline at end of file diff --git a/db/notetagmapper.php b/db/notetagmapper.php new file mode 100644 index 0000000..d540eff --- /dev/null +++ b/db/notetagmapper.php @@ -0,0 +1,23 @@ +findEntity($sql, [$id, $userId]); + } + + public function findAll($userId) { + $sql = 'SELECT * FROM *PREFIX*quicknotes_note_tags WHERE user_id = ?'; + return $this->findEntities($sql, [$userId]); + } + +} \ No newline at end of file diff --git a/db/tag.php b/db/tag.php new file mode 100644 index 0000000..b6a618a --- /dev/null +++ b/db/tag.php @@ -0,0 +1,21 @@ + $this->id, + 'name' => $this->name, + 'userid' => $this->userId + ]; + } + +} \ No newline at end of file diff --git a/db/tagmapper.php b/db/tagmapper.php new file mode 100644 index 0000000..6bb4161 --- /dev/null +++ b/db/tagmapper.php @@ -0,0 +1,23 @@ +findEntity($sql, [$id, $userId]); + } + + public function findAll($userId) { + $sql = 'SELECT * FROM *PREFIX*quicknotes_tags WHERE user_id = ?'; + return $this->findEntities($sql, [$userId]); + } + +} \ No newline at end of file