'', __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;
}
+
+ /**
+ * 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