diff options
author | René Gieling <github@dartcafe.de> | 2020-01-26 20:55:22 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-26 20:55:22 +0300 |
commit | 3b2695e62217acb084bd12c8ac9d4d6cad980972 (patch) | |
tree | aa750cd5cefbb7a66f98d1e7332041697c71903f /lib/Db/CommentMapper.php | |
parent | a428b645d80b5f2d63e1fcfac0b8bfa5d0819dd4 (diff) | |
parent | 09e8d4b95f81340263504477392d2878a8cdbc1a (diff) |
Merge pull request #786 from nextcloud/deleteCommentsv1.2.0-beta
Delete comments
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 |