diff --git a/core/trunk/core/class/ActionControler.php b/core/trunk/core/class/ActionControler.php index 05a5ec992cfb86b1aeb69180dc16c2087e5ce673..f647831a4efdb3d936e004d610214204ab2d25a2 100644 --- a/core/trunk/core/class/ActionControler.php +++ b/core/trunk/core/class/ActionControler.php @@ -130,6 +130,50 @@ class ActionControler } + /** + * Returns an Action array of Object based on all action + * + * @return Action array of objects with properties from the database or null + */ + public function getAllActions() + { + self::connect(); + $query = "select * from ".self::$actions_table; + + try{ + if($_ENV['DEBUG']){echo $query.' // ';} + self::$db->query($query); + } catch (Exception $e){ + echo _NO_ACTION; + } + + if(self::$db->nb_result() > 0) + { + $actions_list = array(); + + + while($queryResult=self::$db->fetch_object()){ + + $action = new Action(); + + foreach($queryResult as $key => $value){ + $action->$key=$value; + } + array_push($actions_list, $action); + + } + + self::disconnect(); + return $actions_list; + } + else + { + self::disconnect(); + return null; + } + } + + /** * Saves in the database an Action object *