public function getDateSortedJobs() { $output = ''; $request = Controller::curr()->getRequest(); $foundation = $request->requestVar('foundation'); $jobs = $this->repository->getDateSortedJobs($foundation); foreach ($jobs as $job) { $output .= $job->renderWith('JobHolder_job', ['FormattedMoreInfoLink' => $this->getViewInfoLink($job->MoreInfoLink)]); } return $output; }
/** * @param SS_HTTPRequest $request * @return mixed|null|SS_HTTPResponse|string */ public function getJobList(SS_HTTPRequest $request) { try { $output = $this->loadRAWResponseFromCache($request); if (!is_null($output)) { return $output; } $output = ''; $kw = $request->getVar('kw'); $type_id = $request->getVar('type_id'); $sort_by = !empty($request->getVar('sort_by')) ? $request->getVar('sort_by') : 'posted'; $jobs = $this->repository->getJobsByKeywordTypeAndSortedBy($kw, $type_id, $sort_by); foreach ($jobs as $job) { $output .= $job->renderWith('JobHolder_job', ['FormattedMoreInfoLink' => JobHolder_Controller::getViewInfoLink($job->MoreInfoLink)]); } $this->saveRAWResponseToCache($request, $output); return $output; } catch (NotFoundEntityException $ex1) { SS_Log::log($ex1, SS_Log::ERR); return $this->notFound($ex1->getMessage()); } catch (Exception $ex) { SS_Log::log($ex, SS_Log::ERR); return $this->serverError(); } }
/** * @return SS_HTTPResponse */ public function getJob() { $job_id = (int) $this->request->param('JOB_ID'); try { $job = $this->repository->getById($job_id); if (!$job) { throw new NotFoundEntityException('Job', sprintf('id %s', $job_id)); } return $this->ok(JobsAssembler::convertJobToArray($job)); } catch (NotFoundEntityException $ex1) { SS_Log::log($ex1, SS_Log::ERR); return $this->notFound($ex1->getMessage()); } catch (Exception $ex) { SS_Log::log($ex, SS_Log::ERR); return $this->serverError(); } }
/** * @return SS_HTTPResponse */ public function getJobList() { try { $output = ''; $foundation = $this->getRequest()->getVar('foundation'); $jobs = $this->repository->getDateSortedJobs($foundation); foreach ($jobs as $job) { $output .= $job->renderWith('JobHolder_job'); } return $output; } catch (NotFoundEntityException $ex1) { SS_Log::log($ex1, SS_Log::ERR); return $this->notFound($ex1->getMessage()); } catch (Exception $ex) { SS_Log::log($ex, SS_Log::ERR); return $this->serverError(); } }
public function getPostedJobsCount() { list($list, $size) = $this->live_repository->getAllPosted(0, PHP_INT_MAX); return count($list); }