diff options
Diffstat (limited to 'lib/Db/CommentMapper.php')
-rw-r--r-- | lib/Db/CommentMapper.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/Db/CommentMapper.php b/lib/Db/CommentMapper.php index c6ac77d2..93da02ae 100644 --- a/lib/Db/CommentMapper.php +++ b/lib/Db/CommentMapper.php @@ -39,6 +39,25 @@ class CommentMapper extends QBMapper { } /** + * @param int $id + * @throws \OCP\AppFramework\Db\DoesNotExistException if not found + * @throws \OCP\AppFramework\Db\MultipleObjectsReturnedException if more than one result + * @return Comment + */ + + public function find($id) { + $qb = $this->db->getQueryBuilder(); + + $qb->select('*') + ->from($this->getTableName()) + ->where( + $qb->expr()->eq('id', $qb->createNamedParameter($id, IQueryBuilder::PARAM_INT)) + ); + + return $this->findEntity($qb); + } + + /** * @param int $pollId * @throws \OCP\AppFramework\Db\DoesNotExistException if not found * @return array |