File tree Expand file tree Collapse file tree 1 file changed +14
-21
lines changed
webapp/src/Controller/Jury Expand file tree Collapse file tree 1 file changed +14
-21
lines changed Original file line number Diff line number Diff line change @@ -77,33 +77,26 @@ public function indexAction(
77
77
->setParameter ('queue ' , $ currentQueue );
78
78
}
79
79
80
+ $ clarifications = $ queryBuilder
81
+ ->getQuery ()
82
+ ->getResult ();
83
+
80
84
/** @var Clarification[] $newClarifications */
81
85
$ newClarifications = [];
82
86
/** @var Clarification[] $oldClarifications */
83
87
$ oldClarifications = [];
84
88
/** @var Clarification[] $generalClarifications */
85
89
$ generalClarifications = [];
86
- $ wheres = [
87
- 'new ' => 'clar.sender IS NOT NULL AND clar.answered = 0 ' ,
88
- 'old ' => 'clar.sender IS NOT NULL AND clar.answered != 0 ' ,
89
- 'general ' => 'clar.sender IS NULL AND clar.in_reply_to IS NULL ' ,
90
- ];
91
- foreach ($ wheres as $ type => $ where ) {
92
- $ clarifications = (clone $ queryBuilder )
93
- ->andWhere ($ where )
94
- ->getQuery ()
95
- ->getResult ();
96
-
97
- switch ($ type ) {
98
- case 'new ' :
99
- $ newClarifications = $ clarifications ;
100
- break ;
101
- case 'old ' :
102
- $ oldClarifications = $ clarifications ;
103
- break ;
104
- case 'general ' :
105
- $ generalClarifications = $ clarifications ;
106
- break ;
90
+
91
+ foreach ($ clarifications as $ clar ) {
92
+ if ($ clar ->getSender () !== null ) {
93
+ if ($ clar ->getAnswered ()) {
94
+ $ oldClarifications [] = $ clar ;
95
+ } else {
96
+ $ newClarifications [] = $ clar ;
97
+ }
98
+ } elseif ($ clar ->getInReplyTo () === null ) {
99
+ $ generalClarifications [] = $ clar ;
107
100
}
108
101
}
109
102
You can’t perform that action at this time.
0 commit comments