blob: cc19ee277ab5c1dcd72206682a97ca67d8656a4c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
<?php
namespace JsonApi\Routes\Mvv;
use JsonApi\Schemas\Subject;
use Psr\Http\Message\ServerRequestInterface as Request;
use Psr\Http\Message\ResponseInterface as Response;
use JsonApi\Errors\RecordNotFoundException;
use JsonApi\JsonApiController;
class SubjectsByCourseOfStudyComponentsShow extends JsonApiController
{
protected $allowedIncludePaths = [
Subject::REL_DEPARTMENTS,
];
/**
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function __invoke(Request $request, Response $response, $args)
{
$component = \StudiengangTeil::find($args['id']);
if (empty($component->fach)) {
throw new RecordNotFoundException('Could not find subject.');
}
return $this->getContentResponse($component->fach);
}
}
|