Resolve "Entity logging service / bundle" #1208

Open
korina.cordero wants to merge 35 commits from 330-entity-logging-service-bundle into master
Showing only changes of commit 025e14ff69 - Show all commits

View file

@ -502,30 +502,18 @@ class UserController extends Controller
public function getLogs(Client $client, $id)
{
error_log('in getLogs');
// fetch database
// TODO: find way to replace hardcoded db name
$database = $client->selectDB('logging_db');
// query will return a resultset object
// TODO: filter query using user id
$result = $database->query('SELECT * FROM entity_log');
// get the points from the resultset, which is an array
$points = $result->getPoints();
error_log('getLogs count points ' . count($points));
// array has format
/*
$rows = [];
foreach ($points as $point)
{
$row['time'] = $point['time'];
error_log($point['entity_type']);
error_log($point['action']);
} */
// TODO: might need to format time data
return $this->json([
'data' => $points,