/**
  * @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;
     }
 }
 /**
  * @param IConsultant $consultant
  * @return array
  */
 public static function convertConsultantToArray(IConsultant $consultant)
 {
     $res = RegionalSupportedCompanyServiceAssembler::convertRegionalSupportedCompanyServiceToArray($consultant);
     //offices
     $res['offices'] = array();
     foreach ($consultant->getOffices() as $office) {
         array_push($res['offices'], self::convertOfficeToArray($office));
     }
     //clients
     $res['reference_clients'] = array();
     foreach ($consultant->getPreviousClients() as $client) {
         array_push($res['reference_clients'], self::convertClientToArray($client));
     }
     //languages
     $res['languages_spoken'] = array();
     foreach ($consultant->getSpokenLanguages() as $language) {
         array_push($res['languages_spoken'], self::convertLanguageToArray($language));
     }
     //expertise areas
     $res['expertise_areas'] = array();
     foreach ($consultant->getExpertiseAreas() as $area) {
         array_push($res['expertise_areas'], $area->getIdentifier());
     }
     //configuration management
     $res['configuration_management'] = array();
     foreach ($consultant->getConfigurationManagementExpertises() as $config_expertise) {
         array_push($res['configuration_management'], $config_expertise->getIdentifier());
     }
     //services offered
     $services_offered = array();
     foreach ($consultant->getServicesOffered() as $offered_service) {
         if (!array_key_exists($offered_service->getIdentifier(), $services_offered)) {
             $services_offered[$offered_service->getIdentifier()] = array();
         }
         array_push($services_offered[$offered_service->getIdentifier()], $offered_service->getRegionId());
     }
     $res['services_offered'] = array();
     foreach ($services_offered as $id => $regions) {
         $aux = array('id' => $id, 'regions' => $regions);
         array_push($res['services_offered'], $aux);
     }
     return $res;
 }