{
"event": "PreToolUse",
"tool_name": "Read",
"tool_input": {
"file_path": "\/var\/www\/dev.campus.systemische-tools.de\/src\/Infrastructure\/Persistence\/ContentConfigRepository.php",
"offset": 149
}
}
{
"tool_response": {
"type": "text",
"file": {
"filePath": "\/var\/www\/dev.campus.systemische-tools.de\/src\/Infrastructure\/Persistence\/ContentConfigRepository.php",
"content": "\n public function getChildren(int $parentId): array\n {\n $stmt = $this->pdo->prepare('SELECT * FROM content_config WHERE parent_id = ? ORDER BY name');\n $stmt->execute([$parentId]);\n\n return $stmt->fetchAll(\\PDO::FETCH_ASSOC);\n }\n\n public function getHistory(int $configId, int $limit = 10): array\n {\n $stmt = $this->pdo->prepare(\n 'SELECT * FROM content_config_history WHERE config_id = ? ORDER BY created_at DESC LIMIT ?'\n );\n $stmt->bindValue(1, $configId, \\PDO::PARAM_INT);\n $stmt->bindValue(2, $limit, \\PDO::PARAM_INT);\n $stmt->execute();\n\n return $stmt->fetchAll(\\PDO::FETCH_ASSOC);\n }\n\n public function getParentOptions(?int $excludeId = null): array\n {\n $stmt = $this->pdo->query(\n 'SELECT id, type, name FROM content_config WHERE type IN (\"contract\", \"organization\") ORDER BY type, name'\n );\n $parents = [];\n foreach ($stmt->fetchAll(\\PDO::FETCH_ASSOC) as $row) {\n if ($excludeId !== null && (int) $row['id'] === $excludeId) {\n continue;\n }\n $parents[] = $row;\n }\n\n return $parents;\n }\n\n public function getStatistics(): array\n {\n $stats = ['total' => 0, 'by_type' => [], 'by_status' => []];\n\n $stmt = $this->pdo->query('SELECT type, COUNT(*) as cnt FROM content_config GROUP BY type');\n foreach ($stmt->fetchAll(\\PDO::FETCH_ASSOC) as $row) {\n $stats['by_type'][$row['type']] = (int) $row['cnt'];\n $stats['total'] += (int) $row['cnt'];\n }\n\n $stmt = $this->pdo->query('SELECT status, COUNT(*) as cnt FROM content_config GROUP BY status');\n foreach ($stmt->fetchAll(\\PDO::FETCH_ASSOC) as $row) {\n $stats['by_status'][$row['status']] = (int) $row['cnt'];\n }\n\n return $stats;\n }\n\n public function getAuthorProfiles(): array\n {\n return $this->findAllByType('author_profile');\n }\n\n public function getSystemPrompts(): array\n {\n return $this->findAllByType('system_prompt');\n }\n\n public function getAuthorProfile(int $id): ?array\n {\n return $this->findByIdAndType($id, 'author_profile');\n }\n\n public function getSystemPrompt(int $id): ?array\n {\n return $this->findByIdAndType($id, 'system_prompt');\n }\n\n public function getStructures(): array\n {\n return $this->findAllByType('structure');\n }\n\n public function getStructure(int $id): ?array\n {\n return $this->findByIdAndType($id, 'structure');\n }\n}\n",
"numLines": 86,
"startLine": 149,
"totalLines": 234
}
}
}