diff options
author | Joas Schilling <coding@schilljs.com> | 2020-10-19 16:34:25 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2020-10-30 12:38:08 +0300 |
commit | a961a26ecc57337c3f89b3decd7899b00f4fda67 (patch) | |
tree | 2f0f5487dcdd8cf4e91a227055704ca8e84f1160 /lib/Model | |
parent | 3c1cb1d9192a1d50c1e991ec9f64ef84181c860b (diff) |
Fix casting of values
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Model')
-rw-r--r-- | lib/Model/Attendee.php | 16 | ||||
-rw-r--r-- | lib/Model/AttendeeMapper.php | 6 | ||||
-rw-r--r-- | lib/Model/Session.php | 8 |
3 files changed, 16 insertions, 14 deletions
diff --git a/lib/Model/Attendee.php b/lib/Model/Attendee.php index 6c5690803..86e0676da 100644 --- a/lib/Model/Attendee.php +++ b/lib/Model/Attendee.php @@ -80,16 +80,16 @@ class Attendee extends Entity { protected $lastMentionMessage; public function __construct() { - $this->addType('room_id', 'int'); - $this->addType('actor_type', 'string'); - $this->addType('actor_id', 'string'); + $this->addType('roomId', 'int'); + $this->addType('actorType', 'string'); + $this->addType('actorId', 'string'); $this->addType('pin', 'string'); - $this->addType('participant_type', 'int'); + $this->addType('participantType', 'int'); $this->addType('favorite', 'bool'); - $this->addType('notification_level', 'int'); - $this->addType('last_joined_call', 'int'); - $this->addType('last_read_message', 'int'); - $this->addType('last_mention_message', 'int'); + $this->addType('notificationLevel', 'int'); + $this->addType('lastJoinedCall', 'int'); + $this->addType('lastReadMessage', 'int'); + $this->addType('lastMentionMessage', 'int'); } /** diff --git a/lib/Model/AttendeeMapper.php b/lib/Model/AttendeeMapper.php index 4c7e7dcd8..1c76253ad 100644 --- a/lib/Model/AttendeeMapper.php +++ b/lib/Model/AttendeeMapper.php @@ -39,17 +39,19 @@ class AttendeeMapper extends QBMapper { } /** + * @param int $roomId * @param string $actorType * @param string $actorId * @return Attendee * @throws \OCP\AppFramework\Db\DoesNotExistException */ - public function findByActor(string $actorType, string $actorId): Attendee { + public function findByActor(int $roomId, string $actorType, string $actorId): Attendee { $query = $this->db->getQueryBuilder(); $query->select('*') ->from($this->getTableName()) ->where($query->expr()->eq('actor_type', $query->createNamedParameter($actorType))) - ->andWhere($query->expr()->eq('actor_id', $query->createNamedParameter($actorId))); + ->andWhere($query->expr()->eq('actor_id', $query->createNamedParameter($actorId))) + ->andWhere($query->expr()->eq('room_id', $query->createNamedParameter($roomId))); return $this->findEntity($query); } diff --git a/lib/Model/Session.php b/lib/Model/Session.php index c647e7082..172e39ef9 100644 --- a/lib/Model/Session.php +++ b/lib/Model/Session.php @@ -50,10 +50,10 @@ class Session extends Entity { protected $lastPing; public function __construct() { - $this->addType('attendee_id', 'int'); - $this->addType('session_id', 'string'); - $this->addType('in_call', 'int'); - $this->addType('last_ping', 'int'); + $this->addType('attendeeId', 'int'); + $this->addType('sessionId', 'string'); + $this->addType('inCall', 'int'); + $this->addType('lastPing', 'int'); } /** |