public static function convertCompanyServiceToArray(ICompanyService $company_service)
 {
     $res = array();
     //header
     $res['id'] = $company_service->getIdentifier();
     $res['name'] = $company_service->getName();
     $res['overview'] = $company_service->getOverview();
     $res['call_2_action_uri'] = $company_service->getCall2ActionUri();
     $res['active'] = $company_service->isActive();
     $company = $company_service->getCompany();
     if ($company) {
         $res['company_id'] = $company->getIdentifier();
     }
     //resources
     $additional_resources = array();
     foreach ($company_service->getResources() as $resource) {
         array_push($additional_resources, CompanyServiceAssembler::convertResource2Array($resource));
     }
     $res['additional_resources'] = $additional_resources;
     //videos
     $videos = array();
     foreach ($company_service->getVideos() as $video) {
         array_push($videos, MarketPlaceAssembler::convertVideo2Array($video));
     }
     $res['videos'] = $videos;
     //draft
     if ($company_service->isDraft()) {
         $res['live_service_id'] = $company_service->getLiveServiceId();
     }
     return $res;
 }
 /**
  * @param ReviewMainInfo $info
  * @return void
  */
 public function registerReviewProduct(ICompanyService $companyService)
 {
     $this->CompanyServiceID = $companyService->getIdentifier();
 }
 public function unRegister(ICompanyService $company_service)
 {
     $repository = $this->repository;
     $this->tx_manager->transaction(function () use($repository, $company_service) {
         $company_id = $company_service->getIdentifier();
         $company_service = $repository->getById($company_id);
         if (!$company_service) {
             throw new NotFoundEntityException('ICompanyService', sprintf("id %s", $company_id));
         }
         $repository->delete($company_service);
     });
 }