/**
  * @param SS_HTTPRequest $request
  * @return string
  */
 function topics(SS_HTTPRequest $request)
 {
     $params = $request->getVars();
     $result = $this->course_topics_query->handle(new OpenStackImplementationNamesQuerySpecification($params["term"]));
     $res = array();
     foreach ($result->getResult() as $dto) {
         array_push($res, array('label' => $dto->getLabel(), 'value' => $dto->getValue()));
     }
     return json_encode($res);
 }
 /**
  * @return string
  */
 public function companies()
 {
     $params = $this->request->getVars();
     $result = $this->companies_names_query->handle(new OpenStackImplementationNamesQuerySpecification($params["term"]));
     $res = array();
     foreach ($result->getResult() as $dto) {
         array_push($res, ['id' => $dto->getId(), 'label' => $dto->getLabel(), 'value' => $dto->getValue()]);
     }
     return json_encode($res);
 }
 public function ServicesCombo()
 {
     $source = array();
     $result = $this->clouds_services_query->handle(new OpenStackImplementationNamesQuerySpecification(''));
     foreach ($result->getResult() as $dto) {
         $source[$dto->getValue()] = $dto->getValue();
     }
     $ddl = new DropdownField('service-term"', $title = null, $source, $value = '');
     $ddl->setEmptyString('-- Show All --');
     return $ddl;
 }
 public function CompanyCombo()
 {
     $source = array();
     $result = $this->course_company_query->handle(new OpenStackImplementationNamesQuerySpecification(DateTimeUtils::getCurrentDate()));
     foreach ($result->getResult() as $dto) {
         $source[$dto->getValue()] = $dto->getValue();
     }
     $ddl = new DropdownField('company-term', $title = null, $source);
     $ddl->setEmptyString('-- Show All --');
     return $ddl;
 }
 public function LevelCombo()
 {
     $source = array();
     $result = $this->course_level_query->handle(new OpenStackImplementationNamesQuerySpecification(''));
     foreach ($result->getResult() as $dto) {
         $source[$dto->getValue()] = $dto->getValue();
     }
     $ddl = new DropdownField('level-term', $title = null, $source);
     $ddl->setEmptyString('-- Show All --');
     return $ddl;
 }