add share icon to owner's note as well

This commit is contained in:
Vinzenz
2016-05-31 17:23:15 +02:00
parent a19bc47bd3
commit c84dbf4d97
5 changed files with 26 additions and 2 deletions

View File

@@ -12,6 +12,7 @@ class Note extends Entity implements JsonSerializable {
protected $timestamp;
protected $colorId;
protected $userId;
protected $sharedWith;
protected $isShared;
protected $color;
@@ -29,6 +30,7 @@ class Note extends Entity implements JsonSerializable {
'colorid' => $this->colorId,
'color' => $this->color,
'userid' => $this->userId,
'sharedwith' => $this->sharedWith,
'isshared' => $this->isShared
];
}

View File

@@ -26,6 +26,11 @@ class NoteShareMapper extends Mapper {
return $this->findEntities($sql, [$groupId]);
}
public function getSharesForNote($noteId) {
$sql = 'SELECT * FROM *PREFIX*quicknotes_shares WHERE note_id = ?';
return $this->findEntities($sql, [$noteId]);
}
public function deleteByNoteId($noteId) {
$sql = 'DELETE FROM *PREFIX*quicknotes_shares WHERE note_id = ?';
$this->execute($sql, [$noteId]);