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

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib/Model
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2021-10-04 18:26:17 +0300
committerGitHub <noreply@github.com>2021-10-04 18:26:17 +0300
commit820342ee28a919da20442561e64eee2b559f1650 (patch)
tree970dea8ff65cff59a9bde7a21ee784b24459c2e7 /lib/Model
parentd9903b759e081602cda7ee8a23c01f48dca2b357 (diff)
parent257d026b6857f428fe7c00513213570b909546c0 (diff)
Merge pull request #6105 from nextcloud/enh/5723/sending-shares
Add sending room shares support
Diffstat (limited to 'lib/Model')
-rw-r--r--lib/Model/AttendeeMapper.php39
1 files changed, 38 insertions, 1 deletions
diff --git a/lib/Model/AttendeeMapper.php b/lib/Model/AttendeeMapper.php
index 261b949b0..89a9460d3 100644
--- a/lib/Model/AttendeeMapper.php
+++ b/lib/Model/AttendeeMapper.php
@@ -73,7 +73,25 @@ class AttendeeMapper extends QBMapper {
$query = $this->db->getQueryBuilder();
$query->select('*')
->from($this->getTableName())
- ->where($query->expr()->eq('id', $query->createNamedParameter($id)));
+ ->where($query->expr()->eq('id', $query->createNamedParameter($id, IQueryBuilder::PARAM_INT)));
+
+ return $this->findEntity($query);
+ }
+
+ /**
+ * @param int $id
+ * @param string $token
+ * @return Attendee
+ * @throws DBException
+ * @throws DoesNotExistException
+ * @throws MultipleObjectsReturnedException
+ */
+ public function getByRemoteIdAndToken(int $id, string $token): Attendee {
+ $query = $this->db->getQueryBuilder();
+ $query->select('*')
+ ->from($this->getTableName())
+ ->where($query->expr()->eq('remote_id', $query->createNamedParameter($id, IQueryBuilder::PARAM_STR)))
+ ->andWhere($query->expr()->eq('access_token', $query->createNamedParameter($token, IQueryBuilder::PARAM_STR)));
return $this->findEntity($query);
}
@@ -100,6 +118,25 @@ class AttendeeMapper extends QBMapper {
/**
* @param int $roomId
+ * @param array $participantType
+ * @return Attendee[]
+ * @throws DBException
+ */
+ public function getActorsByParticipantTypes(int $roomId, array $participantType): array {
+ $query = $this->db->getQueryBuilder();
+ $query->select('*')
+ ->from($this->getTableName())
+ ->where($query->expr()->eq('room_id', $query->createNamedParameter($roomId, IQueryBuilder::PARAM_INT)));
+
+ if (!empty($participantType)) {
+ $query->andWhere($query->expr()->in('participant_type', $query->createNamedParameter($participantType, IQueryBuilder::PARAM_INT_ARRAY)));
+ }
+
+ return $this->findEntities($query);
+ }
+
+ /**
+ * @param int $roomId
* @param string $actorType
* @param int|null $lastJoinedCall
* @return int