diff options
author | dartcafe <github@dartcafe.de> | 2020-07-26 20:35:11 +0300 |
---|---|---|
committer | dartcafe <github@dartcafe.de> | 2020-07-26 20:35:11 +0300 |
commit | e857f1450b8e916b675a907fe75f236ad5cd9c99 (patch) | |
tree | ab557dae7d3ce0a0a7643b043b13d35b47d6ceaf /lib/Db | |
parent | 7dd22d2073fd7eef0be8f52c5979817add6cc1df (diff) |
copy participants addresses to clipboard
Diffstat (limited to 'lib/Db')
-rw-r--r-- | lib/Db/ShareMapper.php | 22 | ||||
-rw-r--r-- | lib/Db/Vote.php | 2 |
2 files changed, 23 insertions, 1 deletions
diff --git a/lib/Db/ShareMapper.php b/lib/Db/ShareMapper.php index 3a4408f3..87df1051 100644 --- a/lib/Db/ShareMapper.php +++ b/lib/Db/ShareMapper.php @@ -71,6 +71,28 @@ class ShareMapper extends QBMapper { } /** + * @param int $pollId + * @param string $userId + * @throws \OCP\AppFramework\Db\DoesNotExistException if not found + * @return array + */ + + public function findByPollAndUser($pollId, $userId) { + $qb = $this->db->getQueryBuilder(); + + $qb->select('*') + ->from($this->getTableName()) + ->where( + $qb->expr()->eq('poll_id', $qb->createNamedParameter($pollId, IQueryBuilder::PARAM_INT)) + ) + ->andWhere( + $qb->expr()->eq('user_id', $qb->createNamedParameter($userId, IQueryBuilder::PARAM_STR)) + ); + + return $this->findEntity($qb); + } + + /** * @param string $token * @throws \OCP\AppFramework\Db\DoesNotExistException if not found * @return Share diff --git a/lib/Db/Vote.php b/lib/Db/Vote.php index 85b63c09..b304c149 100644 --- a/lib/Db/Vote.php +++ b/lib/Db/Vote.php @@ -71,7 +71,7 @@ class Vote extends Entity implements JsonSerializable { ]; } - private function getDisplayName() { + public function getDisplayName() { if (\OC::$server->getUserManager()->get($this->userId) instanceof IUser) { return \OC::$server->getUserManager()->get($this->userId)->getDisplayName(); } else { |