Beispiel #1
0
 /**
  * Get the server configuration from the order detail id
  *
  * @param integer $orderitemId
  * @throws Exception
  */
 public function getServer($orderitemId, $servername)
 {
     // Get the service details
     $service = OrdersItems::getAllInfo($orderitemId);
     if (!$service) {
         return false;
     }
     // Get the server assigned to the hosting service/product
     $server_group_id = isset($service['Products']) && isset($service['Products']['server_group_id']) ? intval($service['Products']['server_group_id']) : 0;
     // Get the server configuration
     $server = Servers::getServerFromGroup($server_group_id, $servername);
     if (empty($server)) {
         throw new Exception("No {$servername} server has been set for the hosting service id: " . $service['detail_id'], "3500");
     }
     return $server;
 }