pg()->insert(" insert into site_log (note) values (?) ", trim($message) ); return $this; } /** * Write a group entry */ public function group(TGroup|CategoryHasArtist $tgroup, ?User $user, string $message): static { $qid = self::$db->get_query_id(); self::$db->prepared_query(" INSERT INTO group_log (GroupID, UserID, Info, TorrentID, Hidden) VALUES (?, ?, ?, 0, 0) ", $tgroup->id(), $user?->id, $message ); self::$db->set_query_id($qid); return $this; } /** * Write a torrent entry */ public function torrent(TorrentAbstract $torrent, ?User $user, string $message): static { $qid = self::$db->get_query_id(); self::$db->prepared_query(" INSERT INTO group_log (GroupID, TorrentID, UserID, Info, Hidden) VALUES (?, ?, ?, ?, 0) ", $torrent->groupId(), $torrent->id, $user?->id, $message ); self::$db->set_query_id($qid); return $this; } public function merge(TGroup $old, TGroup $new): int { self::$db->prepared_query(" UPDATE group_log SET GroupID = ? WHERE GroupID = ? ", $new->id, $old->id ); return self::$db->affected_rows(); } }