From 08f8737a13a14530e53426aa1ee9959de6d2c8ca Mon Sep 17 00:00:00 2001 From: Kevin Chabowski Date: Sun, 20 Nov 2011 21:18:00 +0100 Subject: Added Style::all function. --- ratatoeskr/sys/models.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ratatoeskr/sys/models.php b/ratatoeskr/sys/models.php index 78ef270..892fd2e 100644 --- a/ratatoeskr/sys/models.php +++ b/ratatoeskr/sys/models.php @@ -1096,6 +1096,22 @@ class Style return $obj; } + /* + * Constructor: all + * Get all styles + * + * Returns: + * Array of Style objects + */ + public static function all() + { + $rv = array(); + $result = qdb("SELECT `id` FROM `PREFIX_styles` 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-70-g09d2