{
"event": "PreToolUse",
"tool_name": "Read",
"tool_input": {
"file_path": "\/var\/www\/dev.campus.systemische-tools.de\/src\/Infrastructure\/SemanticExplorerRepository.php",
"offset": 552,
"limit": 80
}
}
{
"tool_response": {
"type": "text",
"file": {
"filePath": "\/var\/www\/dev.campus.systemische-tools.de\/src\/Infrastructure\/SemanticExplorerRepository.php",
"content": " \/\/ =========================================================================\n \/\/ ENTITIES - CRUD\n \/\/ =========================================================================\n\n public function createEntity(string $name, string $type, ?string $description = null): int\n {\n $stmt = $this->db->prepare(\n 'INSERT INTO entities (name, canonical_name, type, description, created_at, updated_at)\n VALUES (:name, :canonical, :type, :description, NOW(), NOW())'\n );\n $stmt->execute([\n 'name' => $name,\n 'canonical' => strtolower(trim($name)),\n 'type' => $type,\n 'description' => $description,\n ]);\n\n return (int) $this->db->lastInsertId();\n }\n\n public function updateEntity(int $id, string $name, string $type, ?string $description = null): bool\n {\n $stmt = $this->db->prepare(\n 'UPDATE entities SET name = :name, canonical_name = :canonical, type = :type,\n description = :description, updated_at = NOW() WHERE id = :id'\n );\n\n return $stmt->execute([\n 'id' => $id,\n 'name' => $name,\n 'canonical' => strtolower(trim($name)),\n 'type' => $type,\n 'description' => $description,\n ]);\n }\n\n public function deleteEntity(int $id): bool\n {\n \/\/ Check for relations\n $stmt = $this->db->prepare(\n 'SELECT COUNT(*) FROM entity_relations\n WHERE source_entity_id = :id OR target_entity_id = :id2'\n );\n $stmt->execute(['id' => $id, 'id2' => $id]);\n\n if ((int) $stmt->fetchColumn() > 0) {\n return false; \/\/ Has relations, cannot delete\n }\n\n \/\/ Delete synonyms first\n $stmt = $this->db->prepare('DELETE FROM entity_synonyms WHERE entity_id = :id');\n $stmt->execute(['id' => $id]);\n\n \/\/ Delete chunk associations\n $stmt = $this->db->prepare('DELETE FROM chunk_entities WHERE entity_id = :id');\n $stmt->execute(['id' => $id]);\n\n \/\/ Delete entity\n $stmt = $this->db->prepare('DELETE FROM entities WHERE id = :id');\n\n return $stmt->execute(['id' => $id]);\n }\n\n public function getEntityTypes(): array\n {\n return ['person', 'organization', 'location', 'concept', 'method', 'tool', 'event', 'other'];\n }\n\n public function getAllEntitiesSimple(): array\n {\n return $this->db->query('SELECT id, name, type FROM entities ORDER BY name')->fetchAll();\n }\n\n \/\/ =========================================================================\n \/\/ RELATIONS - CRUD\n \/\/ =========================================================================\n\n public function getRelation(int $id): ?array\n {\n $stmt = $this->db->prepare(",
"numLines": 80,
"startLine": 552,
"totalLines": 918
}
}
}