public function getCurrentDataCenterLocationsJson()
 {
     $params = $this->request->allParams();
     $company_url_segment = Convert::raw2sql($params["Company"]);
     $slug = Convert::raw2sql($params["Slug"]);
     $query = new QueryObject();
     $query->addAndCondition(QueryCriteria::equal('Slug', $slug));
     $cloud = $this->cloud_repository->getBy($query);
     if (!$cloud) {
         throw new NotFoundEntityException('', '');
     }
     if ($cloud->getCompany()->URLSegment != $company_url_segment) {
         throw new NotFoundEntityException('', '');
     }
     return CloudViewModel::getDataCenterLocationsJson($cloud);
 }
 public function getCurrentDataCenterStaticMapDraftForPDF()
 {
     $static_map_url = "http://maps.googleapis.com/maps/api/staticmap?zoom=1&size=300x200&maptype=roadmap";
     $instance_id = intval($this->request->param('ID'));
     $marketplace_type = $this->request->param('MARKETPLACETYPE');
     $query = new QueryObject();
     $query->addAndCondition(QueryCriteria::id('ID', $instance_id));
     switch (strtolower($marketplace_type)) {
         case 'public_cloud':
             $cloud = $this->public_clouds_draft_repository->getBy($query);
             break;
         case 'private_cloud':
             $cloud = $this->private_clouds_draft_repository->getBy($query);
             break;
     }
     if (!$cloud) {
         throw new NotFoundEntityException('', '');
     }
     $locations = json_decode(CloudViewModel::getDataCenterLocationsJson($cloud));
     foreach ($locations as $loc) {
         $static_map_url .= "&markers=" . $loc->lat . "," . $loc->lng;
     }
     return $static_map_url;
 }