diff options
Diffstat (limited to 'src/Bridge.php')
-rw-r--r-- | src/Bridge.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/Bridge.php b/src/Bridge.php index 2afbd34..7f8996c 100644 --- a/src/Bridge.php +++ b/src/Bridge.php @@ -75,6 +75,19 @@ class Bridge { return $rows; } + public function reserveEditId($postId) { + throw_if_null($postId); + + $sql = 'INSERT INTO posts (post_id) VALUES (' . $postId . ')'; + + $count = $this->db->exec($sql); + if ($count != 1) { + throw new Exception('Failed to register post id: ' . $postId); + } + + return $this->db->lastInsertId(); + } + public function registerMessage($postId, $messageId, $inReplyTo) { throw_if_null($messageId); |