Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

oops

  • Loading branch information...
commit 52aaa3a267dc596c9143a4e43c9b899b5c5afb75 1 parent 461607c
Chris Smith authored July 13, 2009

Showing 1 changed file with 16 additions and 0 deletions. Show diff stats Hide diff stats

  1. 16  includes/classes/vote.php
16  includes/classes/vote.php
@@ -166,6 +166,22 @@ public static function calculate_cost($count, $value, $vote_cost)
166 166
 		return $count * $value * $vote_cost;
167 167
 	}
168 168
 
  169
+	public static function get($id)
  170
+	{
  171
+		global $db;
  172
+
  173
+		$sql = 'SELECT *
  174
+			FROM ' . self::TABLE . '
  175
+			WHERE id = ' . (int) $id;
  176
+
  177
+		$result = $db->sql_query($sql);
  178
+
  179
+		$row = $db->sql_fetchrow($result);
  180
+		$db->sql_freeresult($result);
  181
+
  182
+		return ($row) ? new self($row) : null;
  183
+	}
  184
+
169 185
 	public static function find_by_idea(idea $idea)
170 186
 	{
171 187
 		global $db;

0 notes on commit 52aaa3a

Please sign in to comment.
Something went wrong with that request. Please try again.