diff --git a/module/BrBundle/Controller/Career/VacancyController.php b/module/BrBundle/Controller/Career/VacancyController.php index 3f443bfeb6..51d570e8e3 100644 --- a/module/BrBundle/Controller/Career/VacancyController.php +++ b/module/BrBundle/Controller/Career/VacancyController.php @@ -18,7 +18,7 @@ public function overviewAction() $query = $this->getEntityManager() ->getRepository('BrBundle\Entity\Company\Job') - ->findAllActiveByTypeByDateQuery('vacancy'); + ->findAllActiveByDateQuery(); if ($this->getRequest()->isPost()) { $formData = $this->getRequest()->getPost(); @@ -30,16 +30,18 @@ public function overviewAction() $repository = $this->getEntityManager() ->getRepository('BrBundle\Entity\Company\Job'); + $jobType = $formData['jobType'] == 'all' ? null : $formData['jobType']; + $sector = $formData['sector'] == 'all' ? null : $formData['sector']; $location = $formData['location'] == 'all' ? null : $formData['location']; $master = $formData['master'] == 'all' ? null : $formData['master']; if ($formData['searchType'] == 'company') { - $query = $repository->findAllActiveByTypeQuery('vacancy', $sector, $location, $master); + $query = $repository->findAllActiveByTypeQuery($jobType, $sector, $location, $master); } elseif ($formData['searchType'] == 'vacancy') { - $query = $repository->findAllActiveByTypeSortedByJobNameQuery('vacancy', $sector, $location, $master); + $query = $repository->findAllActiveByTypeSortedByJobNameQuery($jobType, $sector, $location, $master); } elseif ($formData['searchType'] == 'mostRecent') { - $query = $repository->findAllActiveByTypeSortedByDateQuery('vacancy', $sector, $location, $master); + $query = $repository->findAllActiveByTypeSortedByDateQuery($jobType, $sector, $location, $master); } } } @@ -90,7 +92,7 @@ private function getVacancyEntity() { $job = $this->getEntityManager() ->getRepository('BrBundle\Entity\Company\Job') - ->findOneActiveByTypeAndId('vacancy', $this->getParam('id', 0)); + ->findOneActiveById($this->getParam('id', 0)); if (!($job instanceof Job)) { $this->flashMessenger()->error(