13 namespace Fossology\UI\Api\Controllers;
22 use Psr\Http\Message\ServerRequestInterface;
37 $uploadPk = $args[
"id"];
40 $response_view = $this->restHelper->getUploadDao()->getReportInfo($uploadPk);
41 $returnVal =
new Conf($response_view);
42 return $response->withJson($returnVal->getArray(), 200);
56 $uploadPk = $args[
"id"];
58 $confObj =
new Conf();
62 if (empty($body) || !array_key_exists(
"key", $body) ||
63 !array_key_exists(
"value", $body)) {
65 } elseif (!$confObj->doesKeyExist($body[
'key'])) {
71 $value = $body[
'value'];
72 $result = $this->restHelper->getUploadDao()->updateReportInfo($uploadPk,
73 $confObj->getKeyColumnName($key), $value);
76 $info =
new Info(200,
"Successfully updated " . $key, InfoType::INFO);
80 return $response->withJson($info->getarray(), $info->getCode());
updateConfData($request, $response, $args)
getConfInfo($request, $response, $args)
Base controller for REST calls.
getParsedBody(ServerRequestInterface $request)
Parse request body as JSON and return associative PHP array.
Override Slim response for withJson function.
Conf model to contain general error and return values.
Different type of infos provided by REST.
Info model to contain general error and return values.