summaryrefslogtreecommitdiff
path: root/src/Bridge.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Bridge.php')
-rw-r--r--src/Bridge.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Bridge.php b/src/Bridge.php
index ad3b6c3..537fb5c 100644
--- a/src/Bridge.php
+++ b/src/Bridge.php
@@ -53,6 +53,14 @@ class Bridge {
return $row['forum_id'];
}
+ public function setMessageIdIfAbsent($messageId) {
+ $sql = 'INSERT IGNORE INTO posts (message_id) VALUES (' .
+ $this->db->quote($messageId) . ')';
+
+ $count = $this->db->exec($sql);
+ return $count == 1;
+ }
+
protected function get_exactly_one_row($sql) {
$result = $this->db->query($sql);