From e62ddc934464ca5fcd967f5c7ee6681e78c4b696 Mon Sep 17 00:00:00 2001 From: Kevin Chabowski Date: Wed, 16 Nov 2011 22:42:00 +0100 Subject: Added Comment::all(). --- ratatoeskr/sys/models.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ratatoeskr/sys/models.php b/ratatoeskr/sys/models.php index b2f8982..9cfd80c 100644 --- a/ratatoeskr/sys/models.php +++ b/ratatoeskr/sys/models.php @@ -910,6 +910,22 @@ class Comment return $obj; } + /* + * Constructor: all + * Get all comments + * + * Returns: + * Array of Comment objects + */ + public static function all() + { + $rv = array(); + $result = qdb("SELECT `id` FROM `PREFIX_comments` WHERE 1"); + while($sqlrow = mysql_fetch_assoc($result)) + $rv[] = self::by_id($sqlrow["id"]); + return $rv; + } + /* * Function: save * Save changes to database. -- cgit v1.2.3-54-g00ecf