{
"event": "PreToolUse",
"tool_name": "Read",
"tool_input": {
"file_path": "\/var\/www\/dev.campus.systemische-tools.de\/src\/Controller\/Api\/ExplorerController.php",
"offset": 360,
"limit": 60
}
}
{
"tool_response": {
"type": "text",
"file": {
"filePath": "\/var\/www\/dev.campus.systemische-tools.de\/src\/Controller\/Api\/ExplorerController.php",
"content": "\n \/**\n * GET \/api\/v1\/explorer\/entities\n *\/\n public function entities(): void\n {\n try {\n \/\/ Entities aus allen Chunks aggregieren\n $entitiesRaw = $this->db->query(\n 'SELECT entities FROM dokumentation_chunks WHERE entities IS NOT NULL'\n )->fetchAll(\\PDO::FETCH_COLUMN);\n\n $entityCounts = [];\n foreach ($entitiesRaw as $json) {\n $entities = $this->decodeJson($json);\n foreach ($entities as $entity) {\n $name = $entity['name'] ?? '';\n $type = $entity['type'] ?? 'OTHER';\n if ($name !== '') {\n $key = $name . '|' . $type;\n if (!isset($entityCounts[$key])) {\n $entityCounts[$key] = [\n 'name' => $name,\n 'type' => $type,\n 'count' => 0,\n ];\n }\n $entityCounts[$key]['count']++;\n }\n }\n }\n\n \/\/ Sortieren nach Count\n usort($entityCounts, fn ($a, $b) => $b['count'] <=> $a['count']);\n\n \/\/ Nach Typ gruppieren\n $byType = [];\n foreach ($entityCounts as $entity) {\n $type = $entity['type'];\n if (!isset($byType[$type])) {\n $byType[$type] = [];\n }\n $byType[$type][] = $entity;\n }\n\n $this->json([\n 'success' => true,\n 'data' => [\n 'entities' => array_slice($entityCounts, 0, 100),\n 'by_type' => $byType,\n 'total' => count($entityCounts),\n ],\n ]);\n } catch (\\Exception $e) {\n $this->jsonError($e->getMessage());\n }\n }\n\n \/**\n * POST \/api\/v1\/explorer\/suche",
"numLines": 60,
"startLine": 360,
"totalLines": 458
}
}
}