{
"event": "PreToolUse",
"tool_name": "Write",
"tool_input": {
"file_path": "\/var\/www\/dev.campus.systemische-tools.de\/src\/Infrastructure\/Persistence\/ContentSourceRepository.php",
"content": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Infrastructure\\Persistence;\n\n\/\/ @responsibility: Persistenz für Content-Sources\n\nuse Domain\\Repository\\ContentSourceRepositoryInterface;\n\nclass ContentSourceRepository implements ContentSourceRepositoryInterface\n{\n private \\PDO $pdo;\n\n public function __construct(\\PDO $pdo)\n {\n $this->pdo = $pdo;\n }\n\n public function findSourcesByOrder(int $orderId): array\n {\n $stmt = $this->pdo->prepare('\n SELECT cs.*, c.content, d.filename as document_name\n FROM content_sources cs\n JOIN chunks c ON cs.chunk_id = c.id\n JOIN documents d ON c.document_id = d.id\n WHERE cs.order_id = :order_id\n ORDER BY cs.relevance_score DESC\n ');\n $stmt->execute(['order_id' => $orderId]);\n\n return $stmt->fetchAll();\n }\n}\n"
}
}
{
"tool_response": {
"type": "create",
"filePath": "\/var\/www\/dev.campus.systemische-tools.de\/src\/Infrastructure\/Persistence\/ContentSourceRepository.php",
"content": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Infrastructure\\Persistence;\n\n\/\/ @responsibility: Persistenz für Content-Sources\n\nuse Domain\\Repository\\ContentSourceRepositoryInterface;\n\nclass ContentSourceRepository implements ContentSourceRepositoryInterface\n{\n private \\PDO $pdo;\n\n public function __construct(\\PDO $pdo)\n {\n $this->pdo = $pdo;\n }\n\n public function findSourcesByOrder(int $orderId): array\n {\n $stmt = $this->pdo->prepare('\n SELECT cs.*, c.content, d.filename as document_name\n FROM content_sources cs\n JOIN chunks c ON cs.chunk_id = c.id\n JOIN documents d ON c.document_id = d.id\n WHERE cs.order_id = :order_id\n ORDER BY cs.relevance_score DESC\n ');\n $stmt->execute(['order_id' => $orderId]);\n\n return $stmt->fetchAll();\n }\n}\n",
"structuredPatch": [],
"originalFile": null
}
}