diff options
author | uckelman <uckelman@nomic.net> | 2010-04-22 20:57:20 +0000 |
---|---|---|
committer | uckelman <uckelman@nomic.net> | 2010-04-22 20:57:20 +0000 |
commit | 514bc0bd5d84550d7b9c82f3afd6eee76e1748e3 (patch) | |
tree | fcdb5c72481743368c133bf673765f8e71487785 /src | |
parent | 09fb03a4fb46bc43abdf31835f65ee868c08a697 (diff) |
Added unregisterPost().
git-svn-id: https://vassalengine.svn.sourceforge.net/svnroot/vassalengine/site-src/trunk@6728 67b53d14-2c14-4ace-a08f-0dab2b34000c
Diffstat (limited to 'src')
-rw-r--r-- | src/Bridge.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/Bridge.php b/src/Bridge.php index 8b04f03..ba6ccc8 100644 --- a/src/Bridge.php +++ b/src/Bridge.php @@ -99,6 +99,18 @@ class Bridge { } } + public function unregisterPost($postId) { + throw_if_null($postId); + + $sql = 'DELETE FROM posts WHERE post_id = ' . $postId; + + $count = $this->db->exec($sql); + + if ($count != 1) { + throw new Exception('Failed to delete message id: ' . $messageId); + } + } + protected function get_exactly_one_row($sql) { $result = $this->db->query($sql); |