{
"event": "PostToolUse",
"tool_name": "Read",
"tool_response": {
"type": "text",
"file": {
"filePath": "\/var\/www\/dev.campus.systemische-tools.de\/src\/Infrastructure\/Persistence\/RelationRepository.php",
"content": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Infrastructure\\Persistence;\n\n\/\/ @responsibility: CRUD-Operationen für Entity-Relationen\n\nuse Domain\\Repository\\RelationRepositoryInterface;\nuse PDO;\n\nfinal class RelationRepository implements RelationRepositoryInterface\n{\n private PDO $db;\n\n public function __construct(PDO $pdo)\n {\n $this->db = $pdo;\n }\n\n \/**\n * {@inheritDoc}\n *\/\n public function findFiltered(string $type = '', int $limit = 100): array\n {\n $sql = 'SELECT er.*,\n es.name as source_name, es.type as source_type,\n et.name as target_name, et.type as target_type\n FROM entity_relations er\n JOIN entities es ON er.source_entity_id = es.id\n JOIN entities et ON er.target_entity_id = et.id\n WHERE 1=1';\n\n $params = [];\n\n if ($type !== '') {\n $sql .= ' AND er.relation_type = :type';\n $params['type'] = $type;\n }\n\n $sql .= ' ORDER BY er.strength DESC LIMIT ' . $limit;\n\n $stmt = $this->db->prepare($sql);\n $stmt->execute($params);\n\n return $stmt->fetchAll();\n }\n\n \/**\n * {@inheritDoc}",
"numLines": 50,
"startLine": 1,
"totalLines": 146
}
}
}