mirror of
https://github.com/JanGross/quicknotes.git
synced 2026-12-01 02:17:00 +01:00
Put color on own database. Umm.. Any relationship placed on the note controller.
This commit is contained in:
1 parent
b7264d4377
commit
6df7fc0ba8
7 files changed
+163
-21
No files matched your search
@@ -3,6 +3,7 @@ namespace OCA\QuickNotes\Db;
|
||||
|
||||
use OCP\IDb;
|
||||
use OCP\AppFramework\Db\Mapper;
|
||||
use OCP\AppFramework\Db\DoesNotExistException;
|
||||
|
||||
class NoteMapper extends Mapper {
|
||||
|
||||
@@ -20,4 +21,12 @@ class NoteMapper extends Mapper {
|
||||
return $this->findEntities($sql, [$userId]);
|
||||
}
|
||||
|
||||
public function colorIdCount($colorid) {
|
||||
$sql = 'SELECT COUNT(*) as `count` FROM *PREFIX*quicknotes WHERE color_id = ?';
|
||||
$result = $this->execute($sql, [$colorid]);
|
||||
$row = $result->fetch();
|
||||
$result->closeCursor();
|
||||
return $row['count'];
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user