diff options
Diffstat (limited to 'src/SemanticScuttle/Service/Vote.php')
-rw-r--r-- | src/SemanticScuttle/Service/Vote.php | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/SemanticScuttle/Service/Vote.php b/src/SemanticScuttle/Service/Vote.php index 4a5baab..e6d021b 100644 --- a/src/SemanticScuttle/Service/Vote.php +++ b/src/SemanticScuttle/Service/Vote.php @@ -163,14 +163,14 @@ class SemanticScuttle_Service_Vote extends SemanticScuttle_DbService '', __LINE__, __FILE__, $query, $this->db ); //FIXME: throw exception - return false; + return null; } $row = $this->db->sql_fetchrow($dbres); $this->db->sql_freeresult($dbres); if (!$row) { - return false; + return null; } return (int)$row['count'] == 1; @@ -282,6 +282,20 @@ class SemanticScuttle_Service_Vote extends SemanticScuttle_DbService } + + /** + * Delete all votes from the database table. + * Used in unit tests. + * + * @return void + */ + public function deleteAll() + { + $query = 'TRUNCATE TABLE `'. $this->getTableName() .'`'; + $this->db->sql_query($query); + } + + } ?>
\ No newline at end of file |