blob: a3c4d440bb7e4538de981933df0702edf20666bf (
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\ModuleComponent;
use Psr\Http\Message\ServerRequestInterface as Request;
use Psr\Http\Message\ResponseInterface as Response;
use JsonApi\Errors\RecordNotFoundException;
use JsonApi\JsonApiController;
class ModuleComponentsShow extends JsonApiController
{
protected $allowedIncludePaths = [
ModuleComponent::REL_COURSES,
];
/**
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function __invoke(Request $request, Response $response, $args)
{
$component = \Modulteil::find($args['id']);
if (!$component) {
throw new RecordNotFoundException('Could not find module component.');
}
return $this->getContentResponse($component);
}
}
|