Base controller for REST calls.
More...
Base controller for REST calls.
Definition at line 29 of file RestController.php.
◆ __construct()
Fossology\UI\Api\Controllers\RestController::__construct |
( |
|
$container | ) |
|
◆ getParsedBody()
Fossology\UI\Api\Controllers\RestController::getParsedBody |
( |
ServerRequestInterface |
$request | ) |
|
|
protected |
Parse request body as JSON and return associative PHP array.
If request is of type application/json, read the body content and parse with json_decode(). Otherwise, use slim's getParsedBody().
- Parameters
-
ServerRequestInterface | $request | Request to parse |
- Returns
- array|null Parsed JSON, or null on error
Definition at line 69 of file RestController.php.
◆ isItemExists()
Fossology\UI\Api\Controllers\RestController::isItemExists |
( |
int |
$uploadId, |
|
|
int |
$itemId |
|
) |
| |
|
protected |
Check if upload tree is accessible
- Parameters
-
- Returns
- void
- Exceptions
-
Definition at line 119 of file RestController.php.
◆ throwNotAdminException()
Fossology\UI\Api\Controllers\RestController::throwNotAdminException |
( |
| ) |
|
|
protected |
Throw an HttpForbiddenException if the user is not admin.
- Exceptions
-
Definition at line 86 of file RestController.php.
◆ uploadAccessible()
Fossology\UI\Api\Controllers\RestController::uploadAccessible |
( |
|
$id | ) |
|
|
protected |
Check if upload is accessible
- Parameters
-
- Exceptions
-
HttpNotFoundException | Upload not found |
HttpForbiddenException | Upload not accessible |
Definition at line 100 of file RestController.php.
◆ $container
ContainerInterface Fossology\UI\Api\Controllers\RestController::$container |
|
protected |
◆ $dbHelper
DbHelper Fossology\UI\Api\Controllers\RestController::$dbHelper |
|
protected |
◆ $restHelper
RestHelper Fossology\UI\Api\Controllers\RestController::$restHelper |
|
protected |
The documentation for this class was generated from the following file: