| @@ 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[] |
|
| @@ 68-80 (lines=13) @@ | ||
| 65 | * @param string $key the key that will be used to re-order |
|
| 66 | * @return array |
|
| 67 | */ |
|
| 68 | private function sortResourcesByDefinedOrder($resources, $order, $key) |
|
| 69 | { |
|
| 70 | $result = []; |
|
| 71 | $resources = ArrayHelper::index($resources, $key); |
|
| 72 | ||
| 73 | foreach ($order as $type) { |
|
| 74 | if (isset($resources[$type])) { |
|
| 75 | $result[] = $resources[$type]; |
|
| 76 | } |
|
| 77 | } |
|
| 78 | ||
| 79 | return $result; |
|
| 80 | } |
|
| 81 | ||
| 82 | /** |
|
| 83 | * @return ServerResource[] |
|