15 namespace Fossology\UI\Api\Controllers;
22 use Psr\Container\ContainerInterface;
23 use Psr\Http\Message\ServerRequestInterface;
56 $this->restHelper = $this->container->get(
'helper.restHelper');
57 $this->dbHelper = $this->restHelper->getDbHelper();
71 if (strcasecmp($request->getHeaderLine(
'Content-Type'),
72 "application/json") === 0) {
73 $content = $request->getBody()->getContents();
74 return json_decode($content,
true);
77 return $request->getParsedBody();
102 if (! $this->dbHelper->doesIdExist(
"upload",
"upload_pk", $id)) {
105 if (! $this->restHelper->getUploadDao()->isAccessible($id,
106 $this->restHelper->getGroupId())) {
121 if (!$this->dbHelper->doesIdExist(
122 $this->restHelper->getUploadDao()->getUploadtreeTableName($uploadId),
123 "uploadtree_pk", $itemId)) {
Contains the constants and helpers for authentication of user.
static isAdmin()
Check if user is admin.
Base controller for REST calls.
isItemExists(int $uploadId, int $itemId)
getParsedBody(ServerRequestInterface $request)
Parse request body as JSON and return associative PHP array.
Provides helper methods to access database for REST api.
Provides various DAO helper functions for REST api.