diff options
author | uckelman <uckelman@nomic.net> | 2010-04-30 16:07:16 +0000 |
---|---|---|
committer | uckelman <uckelman@nomic.net> | 2010-04-30 16:07:16 +0000 |
commit | 2a1fe590b5e2ad5b29fde8d9b50685194cdd7d97 (patch) | |
tree | ac1b7fa95c2c05b1f28301087022a4d3f8fc01f7 /src/Bridge.php | |
parent | 6e7527ef0223e8b28a6bf28c422a68fdae18b3c1 (diff) |
Added reserveEditId().
git-svn-id: https://vassalengine.svn.sourceforge.net/svnroot/vassalengine/site-src/trunk@6780 67b53d14-2c14-4ace-a08f-0dab2b34000c
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); |