diff options
author | Gary Kim <gary@garykim.dev> | 2021-08-16 00:09:58 +0300 |
---|---|---|
committer | Gary Kim <gary@garykim.dev> | 2021-09-20 21:30:29 +0300 |
commit | 9f3695d748d163f2de5ea5ef394b8d7a0caf7a6a (patch) | |
tree | 955de07443761f76ccb100fcf1fc5836820a4a04 /lib/Model | |
parent | 886a7753d4424b22e00521a525b8b7d5035b7a30 (diff) |
Set share owner properly
Signed-off-by: Gary Kim <gary@garykim.dev>
Diffstat (limited to 'lib/Model')
-rw-r--r-- | lib/Model/AttendeeMapper.php | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/lib/Model/AttendeeMapper.php b/lib/Model/AttendeeMapper.php index 2599e9d9d..89a9460d3 100644 --- a/lib/Model/AttendeeMapper.php +++ b/lib/Model/AttendeeMapper.php @@ -73,7 +73,7 @@ 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); } @@ -90,8 +90,8 @@ class AttendeeMapper extends QBMapper { $query = $this->db->getQueryBuilder(); $query->select('*') ->from($this->getTableName()) - ->where($query->expr()->eq('id', $query->createNamedParameter($id))) - ->andWhere($query->expr()->eq('access_token', $query->createNamedParameter($token))); + ->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); } @@ -118,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 |