Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/polls.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorsplitt3r <splitt3r@users.noreply.github.com>2017-10-11 12:22:19 +0300
committersplitt3r <splitt3r@users.noreply.github.com>2017-10-11 12:22:19 +0300
commit3119ece51a3ae82e2c81e05506612d6242a980ba (patch)
tree2a84298876911ab5f48607335ce810fdf8f4cb37 /lib
parent3e4a02f028531ff11851115fb85628bd6911d71c (diff)
parent443c3c0e3a2589253fee03556b4c1bc1ee7f43f8 (diff)
Merge RC 0.8 in feature/refactor
Diffstat (limited to 'lib')
-rw-r--r--lib/Controller/PageController.php2
-rw-r--r--lib/Db/ParticipationTextMapper.php11
2 files changed, 13 insertions, 0 deletions
diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php
index 15b31054..15f07427 100644
--- a/lib/Controller/PageController.php
+++ b/lib/Controller/PageController.php
@@ -134,10 +134,12 @@ class PageController extends Controller {
$polls = $this->eventMapper->findAllForUserWithInfo($this->userId);
$comments = $this->commentMapper->findDistinctByUser($this->userId);
$partic = $this->participationMapper->findDistinctByUser($this->userId);
+ $particText = $this->participationTextMapper->findDistinctByUser($this->userId);
$response = new TemplateResponse('polls', 'main.tmpl', [
'polls' => $polls,
'comments' => $comments,
'participations' => $partic,
+ 'participations_text' => $particText,
'userId' => $this->userId,
'userMgr' => $this->manager,
'urlGenerator' => $this->urlGenerator
diff --git a/lib/Db/ParticipationTextMapper.php b/lib/Db/ParticipationTextMapper.php
index 58f92f23..a5a290df 100644
--- a/lib/Db/ParticipationTextMapper.php
+++ b/lib/Db/ParticipationTextMapper.php
@@ -47,6 +47,17 @@ class ParticipationTextMapper extends Mapper {
return $this->findEntities($sql, [$pollId], $limit, $offset);
}
+ /**
+ * @param string $userId
+ * @param int $limit
+ * @param int $offset
+ * @return ParticipationText[]
+ */
+ public function findDistinctByUser($userId, $limit = null, $offset = null) {
+ $sql = 'SELECT DISTINCT * FROM ' . $this->getTableName() . ' WHERE user_id = ?';
+ return $this->findEntities($sql, [$userId], $limit, $offset);
+ }
+
/**
* @param string $pollId
*/