findEntity($sql, [$id, $userId]); } public function findAll($userId) { $sql = 'SELECT * FROM *PREFIX*quicknotes_note_tags WHERE user_id = ?'; return $this->findEntities($sql, [$userId]); } public function findNoteTag($userId, $noteId, $tagId) { $sql = 'SELECT * FROM *PREFIX*quicknotes_note_tags WHERE user_id = ? AND note_id = ? AND tag_id = ?'; return $this->findEntity($sql, [$userId, $noteId, $tagId]); } public function noteTagExists($userId, $noteId, $tagId) { $sql = 'SELECT * FROM *PREFIX*quicknotes_note_tags WHERE user_id = ? AND note_id = ? AND tag_id = ?'; try { return $this->findEntities($sql, [$userId, $noteId, $tagId]); } catch (DoesNotExistException $e) { return false; } return true; } }