{
"event": "PreToolUse",
"tool_name": "Read",
"tool_input": {
"file_path": "\/var\/www\/dev.campus.systemische-tools.de\/src\/Controller\/TaxonomyController.php",
"offset": 53,
"limit": 100
}
}
{
"tool_response": {
"type": "text",
"file": {
"filePath": "\/var\/www\/dev.campus.systemische-tools.de\/src\/Controller\/OntologyController.php",
"content": " }\n\n \/**\n * POST \/semantic-explorer\/ontologie\n *\/\n public function store(): 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 $id = $this->repository->create($name, $parentId, $description, $properties);\n\n \/\/ Audit log\n $this->audit->logCreate(\n table: 'ontology_classes',\n id: $id,\n data: ['name' => $name, 'parent_class_id' => $parentId, 'description' => $description],\n actor: 'user',\n actorType: 'user'\n );\n\n $this->json($this->apiFormatter->created($id, 'Ontologie-Klasse erstellt'));\n } catch (\\Exception $e) {\n $this->json($this->apiFormatter->error($e->getMessage(), 'SERVER_ERROR'), 500);\n }\n }\n\n \/**\n * GET \/semantic-explorer\/ontologie\/{id}\/edit\n *\/\n public function edit(int $id): void\n {\n $class = $this->repository->find($id);\n\n if ($class === null) {\n $this->notFound('Klasse nicht gefunden');\n }\n\n $this->view('semantic-explorer.ontologie.edit', [\n 'title' => 'Klasse bearbeiten',\n 'class' => $class,\n '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",
"numLines": 100,
"startLine": 75,
"totalLines": 201
}
}
}