{
"event": "PreToolUse",
"tool_name": "Read",
"tool_input": {
"file_path": "\/var\/www\/dev.campus.systemische-tools.de\/src\/Controller\/OntologyController.php",
"offset": 148,
"limit": 60
}
}
{
"tool_response": {
"type": "text",
"file": {
"filePath": "\/var\/www\/dev.campus.systemische-tools.de\/src\/Controller\/OntologyController.php",
"content": " 'classes' => $this->repository->findForSelect(),\n ]);\n }\n\n \/**\n * POST \/semantic-explorer\/ontologie\/{id}\n *\/\n public function update(int $id): void\n {\n $input = $this->getJsonInput();\n\n $name = trim($input['name'] ?? '');\n $parentId = isset($input['parent_class_id']) && $input['parent_class_id'] !== '' ? (int) $input['parent_class_id'] : null;\n $description = trim($input['description'] ?? '') ?: null;\n $properties = $input['properties'] ?? [];\n\n if ($name === '') {\n $this->json($this->apiFormatter->validationError('Name ist erforderlich', ['name' => 'Pflichtfeld']), 400);\n\n return;\n }\n\n try {\n \/\/ Get old state for audit\n $oldClass = $this->repository->find($id);\n\n $this->repository->update($id, $name, $parentId, $description, $properties);\n\n \/\/ Audit log\n $this->audit->logUpdate(\n table: 'ontology_classes',\n id: $id,\n oldData: $oldClass !== null ? ['name' => $oldClass['name'], 'description' => $oldClass['description'] ?? null] : [],\n newData: ['name' => $name, 'parent_class_id' => $parentId, 'description' => $description],\n actor: 'user',\n actorType: 'user'\n );\n\n $this->json($this->apiFormatter->ok('Ontologie-Klasse aktualisiert'));\n } catch (\\Exception $e) {\n $this->json($this->apiFormatter->error($e->getMessage(), 'SERVER_ERROR'), 500);\n }\n }\n\n \/**\n * POST \/semantic-explorer\/ontologie\/{id}\/delete\n *\/\n public function destroy(int $id): void\n {\n try {\n \/\/ Get data before delete for audit\n $class = $this->repository->find($id);\n\n $success = $this->repository->delete($id);\n if ($success) {\n \/\/ Audit log\n $this->audit->logDelete(\n table: 'ontology_classes',\n id: $id,\n data: $class !== null ? ['name' => $class['name'], 'description' => $class['description'] ?? null] : [],",
"numLines": 60,
"startLine": 148,
"totalLines": 222
}
}
}