blob: 6a3e0a981848d1a5076fc422725bed99126e5b40 (
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
30
31
32
33
34
35
|
<?php
namespace JsonApi\Routes\Institutes;
use Psr\Http\Message\ServerRequestInterface as Request;
use Psr\Http\Message\ResponseInterface as Response;
use JsonApi\Errors\AuthorizationFailedException;
use JsonApi\Errors\RecordNotFoundException;
use JsonApi\JsonApiController;
use JsonApi\Schemas\Institute as InstituteSchema;
/**
* Zeigt eine bestimmte Einrichtung an.
*/
class InstitutesShow extends JsonApiController
{
protected $allowedIncludePaths = [
InstituteSchema::REL_FACULTY,
InstituteSchema::REL_STATUS_GROUPS,
InstituteSchema::REL_SUB_INSTITUTES,
InstituteSchema::REL_COURSES_OF_STUDY,
];
/**
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function __invoke(Request $request, Response $response, $args)
{
if (!$institute = \Institute::find($args['id'])) {
throw new RecordNotFoundException();
}
return $this->getContentResponse($institute);
}
}
|