{
"event": "PostToolUse",
"tool_name": "Grep",
"tool_response": {
"mode": "content",
"numFiles": 0,
"filenames": [],
"content": "64- * POST \/semantic-explorer\/relationen\n65- *\/\n66: public function store(): void\n67- {\n68- $input = $this->getJsonInput();\n69-\n70- $sourceId = (int) ($input['source_entity_id'] ?? 0);\n71- $targetId = (int) ($input['target_entity_id'] ?? 0);\n72- $type = trim($input['relation_type'] ?? '');\n73- $strength = (float) ($input['strength'] ?? 1.0);\n74-\n75- if ($sourceId === 0 || $targetId === 0 || $type === '') {\n76- $this->json($this->apiFormatter->validationError('Alle Felder sind erforderlich'), 400);\n77-\n78- return;\n79- }\n80-\n81- try {\n82- $id = $this->relationRepository->create($sourceId, $targetId, $type, $strength);\n83- $this->json($this->apiFormatter->created($id, 'Relation erstellt'));\n84- } catch (\\Exception $e) {\n85- $this->json($this->apiFormatter->error($e->getMessage(), 'SERVER_ERROR'), 500);\n86- }\n87- }\n88-\n89- \/**\n90- * GET \/semantic-explorer\/relationen\/{id}\/edit\n91- *\/\n--\n108- * POST \/semantic-explorer\/relationen\/{id}\n109- *\/\n110: public function update(int $id): void\n111- {\n112- $input = $this->getJsonInput();\n113-\n114- $type = trim($input['relation_type'] ?? '');\n115- $strength = (float) ($input['strength'] ?? 1.0);\n116-\n117- if ($type === '') {\n118- $this->json($this->apiFormatter->validationError('Beziehungstyp ist erforderlich', ['relation_type' => 'Pflichtfeld']), 400);\n119-\n120- return;\n121- }\n122-\n123- try {\n124- $this->relationRepository->update($id, $type, $strength);\n125- $this->json($this->apiFormatter->ok('Relation aktualisiert'));\n126- } catch (\\Exception $e) {\n127- $this->json($this->apiFormatter->error($e->getMessage(), 'SERVER_ERROR'), 500);\n128- }\n129- }\n130-\n131- \/**\n132- * POST \/semantic-explorer\/relationen\/{id}\/delete\n133- *\/\n134- public function destroy(int $id): void\n135- {",
"numLines": 57
}
}