|
@@ -89,18 +89,24 @@ class GetAllViewHelper extends OtAbstractViewHelper {
|
|
|
|
|
|
|
|
// Sort by instrument (conductor first), then alphabetically by name
|
|
// Sort by instrument (conductor first), then alphabetically by name
|
|
|
usort($members,
|
|
usort($members,
|
|
|
- function($a, $b) {
|
|
|
|
|
- if ($a->getInstrument() == 'CONDUCTOR') {
|
|
|
|
|
|
|
+ static function($a, $b) {
|
|
|
|
|
+ if ($a->getInstrument() === 'CONDUCTOR') {
|
|
|
return -1;
|
|
return -1;
|
|
|
- } else if ($b->getInstrument() == 'CONDUCTOR') {
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if ($b->getInstrument() === 'CONDUCTOR') {
|
|
|
return 1;
|
|
return 1;
|
|
|
- } else if ($a->getInstrument() != $b->getInstrument()) {
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if ($a->getInstrument() !== $b->getInstrument()) {
|
|
|
return strcmp($a->getInstrument(), $b->getInstrument());
|
|
return strcmp($a->getInstrument(), $b->getInstrument());
|
|
|
- } else if ($a->getName() != $b->getName()) {
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if ($a->getName() !== $b->getName()) {
|
|
|
return strcmp($a->getName(), $b->getName());
|
|
return strcmp($a->getName(), $b->getName());
|
|
|
- } else {
|
|
|
|
|
- return 0;
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ return 0;
|
|
|
}
|
|
}
|
|
|
);
|
|
);
|
|
|
|
|
|
|
@@ -113,13 +119,13 @@ class GetAllViewHelper extends OtAbstractViewHelper {
|
|
|
foreach ($members as $member) {
|
|
foreach ($members as $member) {
|
|
|
// If that Instrument exist in stack1: put it in this one
|
|
// If that Instrument exist in stack1: put it in this one
|
|
|
if (array_key_exists($member->getInstrument(), $stack1)) {
|
|
if (array_key_exists($member->getInstrument(), $stack1)) {
|
|
|
- array_push($stack1[$member->getInstrument()], $member);
|
|
|
|
|
|
|
+ $stack1[$member->getInstrument()][] = $member;
|
|
|
} else {
|
|
} else {
|
|
|
// Create the new array if needed in stack2, then put the member in it
|
|
// Create the new array if needed in stack2, then put the member in it
|
|
|
if (!array_key_exists($member->getInstrument(), $stack2)) {
|
|
if (!array_key_exists($member->getInstrument(), $stack2)) {
|
|
|
$stack2[$member->getInstrument()] = [];
|
|
$stack2[$member->getInstrument()] = [];
|
|
|
}
|
|
}
|
|
|
- array_push($stack2[$member->getInstrument()], $member);
|
|
|
|
|
|
|
+ $stack2[$member->getInstrument()][] = $member;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|