public function LogController::log in TacJS 8.5
Store proof of consent.
Parameters
int $service_key: Unique ID of the service.
Return value
array Empty Array.
Throws
\Exception
1 string reference to 'LogController::log'
File
- src/
Controller/ LogController.php, line 39
Class
Namespace
Drupal\tacjs\ControllerCode
public function log($service_key) {
try {
$this->connection
->insert('tacjslog')
->fields([
'timestamp' => \Drupal::time()
->getCurrentTime(),
'ip_address' => \Drupal::request()
->getClientIp(),
'services_allowed' => $service_key,
])
->execute();
} catch (\Exception $e) {
throw $e;
}
return new JsonResponse([
'timestamp' => \Drupal::time()
->getCurrentTime(),
'ip_address' => \Drupal::request()
->getClientIp(),
'services_allowed' => $service_key,
]);
}