Changeset 405 for trunk/wifidog-auth/wifidog/classes/Node.php
- Timestamp:
- 01/27/05 11:00:52 (8 years ago)
- Files:
-
- 1 modified
-
trunk/wifidog-auth/wifidog/classes/Node.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wifidog-auth/wifidog/classes/Node.php
r402 r405 34 34 * @return a Node object, or null if there was an error 35 35 */ 36 static function get Object($id) {36 static function getNode($id) { 37 37 $object = null; 38 38 $object = new self($id); … … 44 44 * @return the newly created Node object, or null if there was an error 45 45 */ 46 static function create Object($id) {46 static function createNode($id) { 47 47 global $db; 48 48 … … 62 62 $db->ExecSqlUniqueRes($sql, $row, false); 63 63 if ($row == null) { 64 throw new Exception(_("The id $node_id_str could not be found in the database") , "EXCEPTION_CREATE_OBJECT_FAILED");64 throw new Exception(_("The id $node_id_str could not be found in the database")); 65 65 } 66 66 $this->mRow = $row; … … 96 96 97 97 $db->ExecSql("SELECT * FROM nodes", $nodes, false); 98 98 99 if ($nodes == null) { 99 throw new Exception(_("No nodes could not be found in the database"), "EXCEPTION_NO_NODES"); 100 throw new Exception(_("No nodes could not be found in the database")); 101 } 102 return $nodes; 103 } 104 105 static function getAllNodesOrdered($order_by) { 106 global $db; 107 108 $db->ExecSql("SELECT * FROM nodes ORDER BY $order_by", $nodes, false); 109 110 if ($nodes == null) { 111 throw new Exception(_("No nodes could not be found in the database")); 112 } 113 return $nodes; 114 } 115 116 static function getAllNodesWithStatus() { 117 global $db; 118 $db->ExecSql("SELECT node_id, name, last_heartbeat_user_agent, (NOW()-last_heartbeat_timestamp) AS since_last_heartbeat, last_heartbeat_ip, CASE WHEN ((NOW()-last_heartbeat_timestamp) < interval '5 minutes') THEN true ELSE false END AS online, creation_date FROM nodes ORDER BY node_id", $nodes, false); 119 if ($nodes == null) { 120 throw new Exception(_("No nodes could not be found in the database")); 100 121 } 101 122 return $nodes; … … 107 128 $db->ExecSql("SELECT * FROM node_deployment_status", $statuses, false); 108 129 if ($statuses == null) { 109 throw new Exception(_("No deployment statues could be found in the database") , "EXCEPTION_NO_STATUSES");130 throw new Exception(_("No deployment statues could be found in the database")); 110 131 } 111 132 $statuses_array = array();
