Skip to content
Snippets Groups Projects
Commit 59f28b27 authored by Tobias Gross-Vogt's avatar Tobias Gross-Vogt
Browse files

getCourseById throws instead of returning null

parent 3da3ec44
No related branches found
No related tags found
No related merge requests found
Pipeline #108575 passed
......@@ -6,28 +6,40 @@ namespace Dbp\Relay\BaseCourseBundle\API;
use Dbp\Relay\BaseCourseBundle\Entity\Course;
use Dbp\Relay\BaseCourseBundle\Entity\CourseAttendee;
use Dbp\Relay\CoreBundle\Exception\ApiError;
interface CourseProviderInterface
{
public function getCourseById(string $identifier, array $options = []): ?Course;
/**
* @throws ApiError
*/
public function getCourseById(string $identifier, array $options = []): Course;
/**
* @return Course[]
*
* @throws ApiError
*/
public function getCourses(array $options = []): array;
/**
* @return Course[]
*
* @throws ApiError
*/
public function getCoursesByOrganization(string $orgUnitId, array $options = []): array;
/**
* @return Course[]
*
* @throws ApiError
*/
public function getCoursesByLecturer(string $lecturerId, array $options = []): array;
/**
* @return CourseAttendee[]
*
* @throws ApiError
*/
public function getAttendeesByCourse(string $courseId, array $options = []): array;
}
......@@ -10,7 +10,7 @@ use Dbp\Relay\BaseCourseBundle\Entity\CourseAttendee;
class DummyCourseProvider implements CourseProviderInterface
{
public function getCourseById(string $identifier, array $options = []): ?Course
public function getCourseById(string $identifier, array $options = []): Course
{
$course = new Course();
$course->setIdentifier($identifier);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment