@@ -593,15 +593,12 @@ public function getParticipantByAttendeeId(int $attendeeId): Participant {
593593 /**
594594 * @param string $actorType
595595 * @param string $actorId
596- * @param string|null|false $sessionId Set to false if you don't want to load a session (and save resources),
597- * string to try loading a specific session
598- * null to try loading "any"
599596 * @return Participant
600597 * @throws ParticipantNotFoundException When the pin is not valid (has no participant assigned)
601598 */
602- public function getParticipantByActor (string $ actorType , string $ actorId, $ sessionId = null ): Participant {
599+ public function getParticipantByActor (string $ actorType , string $ actorId ): Participant {
603600 if ($ actorType === Attendee::ACTOR_USERS ) {
604- return $ this ->getParticipant ($ actorId , $ sessionId );
601+ return $ this ->getParticipant ($ actorId , false );
605602 }
606603
607604 $ query = $ this ->db ->getQueryBuilder ();
@@ -613,20 +610,6 @@ public function getParticipantByActor(string $actorType, string $actorId, $sessi
613610 ->andWhere ($ query ->expr ()->eq ('a.room_id ' , $ query ->createNamedParameter ($ this ->getId ())))
614611 ->setMaxResults (1 );
615612
616- if ($ sessionId !== false ) {
617- if ($ sessionId !== null ) {
618- $ helper ->selectSessionsTable ($ query );
619- $ query ->leftJoin ('a ' , 'talk_sessions ' , 's ' , $ query ->expr ()->andX (
620- $ query ->expr ()->eq ('s.session_id ' , $ query ->createNamedParameter ($ sessionId )),
621- $ query ->expr ()->eq ('a.id ' , 's.attendee_id ' )
622- ));
623- } else {
624- $ helper ->selectSessionsTableMax ($ query );
625- $ query ->groupBy ('a.id ' );
626- $ query ->leftJoin ('a ' , 'talk_sessions ' , 's ' , $ query ->expr ()->eq ('a.id ' , 's.attendee_id ' ));
627- }
628- }
629-
630613 $ result = $ query ->executeQuery ();
631614 $ row = $ result ->fetch ();
632615 $ result ->closeCursor ();
0 commit comments