Skip to content

Commit

Permalink
revert some changes
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrodevog committed Nov 7, 2023
1 parent 3eb2f22 commit fde848e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions module/BrBundle/Controller/Career/VacancyController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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);
}
}
}
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit fde848e

Please sign in to comment.