public function getEnabledPricingSchemas() { $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::getEnabledPricingSchemas($cloud); }
public function getEnabledPricingSchemasDraft() { $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('', ''); } return CloudViewModel::getEnabledPricingSchemas($cloud); }