/** * Get Data * * @return array value => description */ function getData() { // Query ServerDBO's $servers = array(); try { // Convery to an array: hosting ID => hosting service name $serverDBOs = load_array_ServerDBO(); foreach ($serverDBOs as $serverDBO) { $servers[$serverDBO->getID()] = $serverDBO->getHostname(); } } catch (DBNoRowsFoundException $e) { } return $servers; }
/** * Initialize the Table * * @param array $params Parameters from the {form_table} tag */ public function init($params) { parent::init($params); // Load the Server Table try { // Build the table $servers = load_array_ServerDBO($where); foreach ($servers as $dbo) { // Put the row into the table $this->data[] = array("id" => $dbo->getID(), "hostname" => $dbo->getHostName(), "location" => $dbo->getLocation()); } } catch (DBNoRowsFoundException $e) { } }