public static function convertCloudToArray(ICloudService $cloud)
 {
     $res = OpenStackImplementationAssembler::convertOpenStackImplementationToArray($cloud);
     //override capabilities
     $res['capabilities'] = array();
     foreach ($cloud->getCapabilities() as $service) {
         $service_res = OpenStackImplementationAssembler::convertCapabilityToArray($service);
         if (is_null($service_res)) {
             continue;
         }
         $service_res['pricing_schemas'] = array();
         foreach ($service->getPricingSchemas() as $ps) {
             array_push($service_res['pricing_schemas'], $ps->getIdentifier());
         }
         array_push($res['capabilities'], $service_res);
     }
     $data_centers = array();
     $locations = array();
     $regions = array();
     foreach ($cloud->getDataCenterRegions() as $region) {
         array_push($regions, CloudAssembler::convertDataCenterRegionToArray($region));
     }
     foreach ($cloud->getDataCentersLocations() as $location) {
         array_push($locations, CloudAssembler::convertDataCenterLocationToArray($location));
     }
     $data_centers['regions'] = $regions;
     $data_centers['locations'] = $locations;
     $res['data_centers'] = $data_centers;
     return $res;
 }
 /**
  * @param IOpenStackImplementation $implementation
  * @return array
  */
 public static function convertOpenStackImplementationToArray(IOpenStackImplementation $implementation)
 {
     $res = RegionalSupportedCompanyServiceAssembler::convertRegionalSupportedCompanyServiceToArray($implementation);
     $res['compatible_compute'] = $implementation->isCompatibleWithCompute();
     $res['compatible_storage'] = $implementation->isCompatibleWithStorage();
     $res['interop_program_version_id'] = $implementation->getProgramVersion()->getIdentifier();
     $res['compatible_federated_identity'] = $implementation->isCompatibleWithFederatedIdentity();
     //capabilities
     $capabilities = array();
     foreach ($implementation->getCapabilities() as $capability) {
         $capability = OpenStackImplementationAssembler::convertCapabilityToArray($capability);
         if (!is_null($capability)) {
             array_push($capabilities, $capability);
         }
     }
     $res['capabilities'] = $capabilities;
     //hypervisors
     $hypervisors = array();
     foreach ($implementation->getHyperVisors() as $hypervisor) {
         array_push($hypervisors, $hypervisor->getIdentifier());
     }
     $res['hypervisors'] = $hypervisors;
     //os guests
     $guest_os = array();
     foreach ($implementation->getGuests() as $guest) {
         array_push($guest_os, $guest->getIdentifier());
     }
     $res['guest_os'] = $guest_os;
     //draft
     if ($res) {
         return $res;
     }
 }