{
"event": "PreToolUse",
"tool_name": "Read",
"tool_input": {
"file_path": "\/var\/www\/dev.campus.systemische-tools.de\/src\/Controller\/ContentController.php",
"offset": 70,
"limit": 50
}
}
{
"tool_response": {
"type": "text",
"file": {
"filePath": "\/var\/www\/dev.campus.systemische-tools.de\/src\/Controller\/ContentController.php",
"content": "\n \/**\n * POST \/content - Store new order\n *\/\n public function store(): void\n {\n $this->requireCsrf();\n\n $command = CreateContentOrderCommand::fromRequest($_POST);\n $errors = $command->validate();\n\n if ($errors !== []) {\n $_SESSION['error'] = implode(' ', $errors);\n $this->redirect('\/content\/new');\n }\n\n \/\/ Validate collections\n $result = $this->collectionService->validateWithCompatibility($command->collections);\n if (!$result['valid']) {\n $_SESSION['error'] = 'Collection-Fehler: ' . $result['error'];\n $this->redirect('\/content\/new');\n }\n\n $orderId = $this->repository->createOrder([\n 'title' => $command->title,\n 'briefing' => $command->briefing,\n 'author_profile_id' => $command->authorProfileId,\n 'contract_id' => $command->contractId ?? $this->getFirstContractId(),\n 'structure_id' => $command->structureId,\n 'model' => ModelConfig::validate($command->model),\n 'collections' => json_encode($result['collections']),\n 'context_limit' => $command->contextLimit,\n ]);\n\n if ($command->shouldGenerate()) {\n $genResult = $this->generateUseCase->generate(\n $orderId,\n ModelConfig::validate($command->model),\n $result['collections'][0] ?? 'documents',\n $command->contextLimit\n );\n $_SESSION[$genResult->hasError() ? 'error' : 'success'] =\n $genResult->hasError() ? 'Generierung fehlgeschlagen: ' . $genResult->getError() : 'Content wurde generiert.';\n }\n\n $this->redirect('\/content\/' . $orderId);\n }\n\n \/**\n * GET \/content\/{id} - Show order details",
"numLines": 50,
"startLine": 70,
"totalLines": 335
}
}
}