@@ -338,20 +338,24 @@ public function getCourseEvents(int $currentPageNumber, int $maxNumItemsPerPage,
338338 }
339339
340340 /**
341- * @param array $options Available options:
342- * * Locale::LANGUAGE_OPTION (language in ISO 639‑1 format)
341+ * @param string|null $registrationStatus if specified, only attendees with the given registration status are returned, otherwise all attendees are returned
343342 *
344343 * @return array<int, array<string, mixed>>
345344 *
346345 * @throws ApiError
347346 */
348- public function getAttendeesByCourse (string $ courseIdentifier , array $ options = []): array
347+ public function getAttendeesByCourse (
348+ string $ courseIdentifier ,
349+ ?string $ registrationStatus = CourseRegistrationResource::REGISTRATION_STATUS_FIXED ): array
349350 {
350351 $ attendeeIds = [];
351352 foreach ($ this ->getCourseRegistrationResourcesCached ($ courseIdentifier ) as $ registrationResource ) {
352- $ attendeeIds [] = [
353- 'personIdentifier ' => $ registrationResource ->getPersonUid (),
354- ];
353+ if ($ registrationStatus === null
354+ || $ registrationStatus === $ registrationResource ->getRegistrationStatus ()) {
355+ $ attendeeIds [] = [
356+ 'personIdentifier ' => $ registrationResource ->getPersonUid (),
357+ ];
358+ }
355359 }
356360
357361 return $ attendeeIds ;
@@ -390,6 +394,7 @@ public function getGroupsByCourse(string $courseIdentifier, array $options = [])
390394 $ courseGroupApi = new CourseGroupApi ($ this ->getCourseApi ()->getConnection ());
391395
392396 $ ATTENDEE_PERSON_IDENTIFIERS_KEY = 'attendeeIdentifiers ' ;
397+ $ ATTENDEE_WAITING_LIST_PERSON_IDENTIFIERS_KEY = 'attendeeWaitingListIdentifiers ' ;
393398 $ LECTURER_PERSON_IDENTIFIERS_KEY = 'lecturerIdentifiers ' ;
394399
395400 $ courseGroupPeopleMap = [];
@@ -398,17 +403,26 @@ public function getGroupsByCourse(string $courseIdentifier, array $options = [])
398403 if (null === ($ courseGroupPeopleMap [$ courseGroupIdentifier ] ?? null )) {
399404 $ courseGroupPeople = [
400405 $ ATTENDEE_PERSON_IDENTIFIERS_KEY => [],
406+ $ ATTENDEE_WAITING_LIST_PERSON_IDENTIFIERS_KEY => [],
401407 $ LECTURER_PERSON_IDENTIFIERS_KEY => [],
402408 ];
403409 $ courseGroupPeopleMap [$ courseGroupIdentifier ] = $ courseGroupPeople ;
404410 }
405- $ courseGroupPeopleMap [$ courseGroupIdentifier ][$ ATTENDEE_PERSON_IDENTIFIERS_KEY ][] = $ registrationResource ->getPersonUid ();
411+ switch ($ registrationResource ->getRegistrationStatus ()) {
412+ case CourseRegistrationResource::REGISTRATION_STATUS_FIXED :
413+ $ courseGroupPeopleMap [$ courseGroupIdentifier ][$ ATTENDEE_PERSON_IDENTIFIERS_KEY ][] = $ registrationResource ->getPersonUid ();
414+ break ;
415+ case CourseRegistrationResource::REGISTRATION_STATUS_WAITING_LIST :
416+ $ courseGroupPeopleMap [$ courseGroupIdentifier ][$ ATTENDEE_WAITING_LIST_PERSON_IDENTIFIERS_KEY ][] = $ registrationResource ->getPersonUid ();
417+ break ;
418+ }
406419 }
407420 foreach ($ this ->getLectureshipResourcesCached ($ courseIdentifier ) as $ lectureshipResource ) {
408421 foreach ($ lectureshipResource ->getGroupUids () as $ courseGroupIdentifier ) {
409422 if (null === ($ courseGroupPeopleMap [$ courseGroupIdentifier ] ?? null )) {
410423 $ courseGroupPeople = [
411424 $ ATTENDEE_PERSON_IDENTIFIERS_KEY => [],
425+ $ ATTENDEE_WAITING_LIST_PERSON_IDENTIFIERS_KEY => [],
412426 $ LECTURER_PERSON_IDENTIFIERS_KEY => [],
413427 ];
414428 $ courseGroupPeopleMap [$ courseGroupIdentifier ] = $ courseGroupPeople ;
@@ -423,6 +437,7 @@ public function getGroupsByCourse(string $courseIdentifier, array $options = [])
423437 'identifier ' => $ courseGroupPeople ->getUid (),
424438 'name ' => $ courseGroupPeople ->getName (Options::getLanguage ($ options ) ?? self ::DEFAULT_LANGUAGE_TAG ),
425439 $ ATTENDEE_PERSON_IDENTIFIERS_KEY => $ courseGroupPeopleMap [$ courseGroupPeople ->getUid ()][$ ATTENDEE_PERSON_IDENTIFIERS_KEY ] ?? [],
440+ $ ATTENDEE_WAITING_LIST_PERSON_IDENTIFIERS_KEY => $ courseGroupPeopleMap [$ courseGroupPeople ->getUid ()][$ ATTENDEE_WAITING_LIST_PERSON_IDENTIFIERS_KEY ] ?? [],
426441 $ LECTURER_PERSON_IDENTIFIERS_KEY => $ courseGroupPeopleMap [$ courseGroupPeople ->getUid ()][$ LECTURER_PERSON_IDENTIFIERS_KEY ] ?? [],
427442 ];
428443 }
@@ -538,6 +553,7 @@ private function getCourseApi(): CourseApi
538553 $ this ->config [Configuration::CAMPUS_ONLINE_NODE ][Configuration::CLIENT_SECRET_NODE ] ?? ''
539554 )
540555 );
556+ $ this ->courseApi ->setLogger ($ this ->logger );
541557 }
542558
543559 return $ this ->courseApi ;
@@ -576,7 +592,6 @@ public function getCoursesInternal(int $currentPageNumber, int $maxNumItemsPerPa
576592 }
577593
578594 if ($ filter = Options::getFilter ($ options )) {
579- dump ($ filter );
580595 $ pathMapping = [
581596 'identifier ' => $ CACHED_COURSE_ENTITY_ALIAS .'. ' .CachedCourse::UID_COLUMN_NAME ,
582597 'code ' => $ CACHED_COURSE_ENTITY_ALIAS .'. ' .CachedCourse::COURSE_CODE_COLUMN_NAME ,
0 commit comments