Skip to content

Commit

Permalink
indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
fxleblanc committed Mar 2, 2016
1 parent 0fb0a28 commit 05ea6b2
Showing 1 changed file with 40 additions and 34 deletions.
74 changes: 40 additions & 34 deletions src/Controller/MissionsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,59 +141,65 @@ function ($q) use ($tmp) {
}
$chooseStudentUniversity = false;
if (!empty($tmp = $this->request->session()->read('filter.mission.applicationState'))) {
// @codingStandardsIgnoreStart
switch ($tmp) {
case 1: // accepted
$query->matching(
'Applications',
function ($q) {
return $q->where(['Applications.accepted' => true]);
}
);
case 1: // accepted
$query->matching(
'Applications',
function ($q) {
return $q->where(['Applications.accepted' => true]);
}
);
$chooseStudentUniversity = true;
break;
case 2: // rejected
$query->matching(
'Applications',
function ($q) {
return $q->where(['Applications.rejected' => true]);
}
);
break;
case 2: // rejected
$query->matching(
'Applications',
function ($q) {
return $q->where(['Applications.rejected' => true]);
}
);
$chooseStudentUniversity = true;
break;
case 3: // unprocessed
$query->matching(
'Applications',
function ($q) {
return $q->where(['Applications.accepted' => false, 'Applications.rejected' => false]);
}
);
break;
case 3: // unprocessed
$query->matching(
'Applications',
function ($q) {
return $q->where(['Applications.accepted' => false, 'Applications.rejected' => false]);
}
);
$chooseStudentUniversity = true;
break;
break;
}
// @codingStandardsIgnoreEnd
}
if ($chooseStudentUniversity && !empty($tmp = $this->request->session()->read('filter.mission.studentUniversity'))) {
$query->matching(
'Applications.Students.Universities', function ($q) use ($tmp) {
'Applications.Students.Universities',
function ($q) use ($tmp) {
return $q->where(['Universities.id' => $tmp]);
}
);
}
$chooseProfUniversity = false;
if (!empty($tmp = $this->request->session()->read('filter.mission.profFilter'))) {
//@codingStandardsIgnoreStart
switch ($tmp) {
case "hasProfessor":
$query->where(['Missions.professor_id !=' => 0]);
$chooseProfUniversity = true;
break;
case "needsProfessor":
$query->where(['Missions.professor_id' => 0, 'OR' => [['TypeMissions.id' => 3], ['TypeMissions.id' => 4]]]);
$chooseProfUniversity = true;
break;
case "hasProfessor":
$query->where(['Missions.professor_id !=' => 0]);
$chooseProfUniversity = true;
break;
case "needsProfessor":
$query->where(['Missions.professor_id' => 0, 'OR' => [['TypeMissions.id' => 3], ['TypeMissions.id' => 4]]]);
$chooseProfUniversity = true;
break;
}
//@codingStandardsIgnoreEnd
}
if ($chooseProfUniversity && !empty($tmp = $this->request->session()->read('filter.mission.professorUniversity'))) {
$query->matching(
'Professors.Universities', function ($q) use ($tmp) {
'Professors.Universities',
function ($q) use ($tmp) {
return $q->where(['Universities.id' => $tmp]);
}
);
Expand Down

0 comments on commit 05ea6b2

Please sign in to comment.