| @@ 65-77 (lines=13) @@ | ||
| 62 | * @param string $key the key that will be used to re-order |
|
| 63 | * @return array |
|
| 64 | */ |
|
| 65 | private function sortResourcesByDefinedOrder($resources, $order, $key) |
|
| 66 | { |
|
| 67 | $result = []; |
|
| 68 | $resources = ArrayHelper::index($resources, $key); |
|
| 69 | ||
| 70 | foreach ($order as $type) { |
|
| 71 | if (isset($resources[$type])) { |
|
| 72 | $result[] = $resources[$type]; |
|
| 73 | } |
|
| 74 | } |
|
| 75 | ||
| 76 | return $result; |
|
| 77 | } |
|
| 78 | ||
| 79 | /** |
|
| 80 | * @return \hipanel\modules\finance\models\ServerResource[] |
|
| @@ 64-76 (lines=13) @@ | ||
| 61 | * @param string $key the key that will be used to re-order |
|
| 62 | * @return array |
|
| 63 | */ |
|
| 64 | private function sortResourcesByDefinedOrder($resources, $order, $key) |
|
| 65 | { |
|
| 66 | $result = []; |
|
| 67 | $resources = ArrayHelper::index($resources, $key); |
|
| 68 | ||
| 69 | foreach ($order as $type) { |
|
| 70 | if (isset($resources[$type])) { |
|
| 71 | $result[] = $resources[$type]; |
|
| 72 | } |
|
| 73 | } |
|
| 74 | ||
| 75 | return $result; |
|
| 76 | } |
|
| 77 | ||
| 78 | /** |
|
| 79 | * @return \hipanel\modules\finance\models\ServerResource[] |
|