| @@ 7-31 (lines=25) @@ | ||
| 4 | ||
| 5 | use League\Fractal\TransformerAbstract; |
|
| 6 | ||
| 7 | class OutfitLeaderboardTransformer extends TransformerAbstract |
|
| 8 | { |
|
| 9 | /** |
|
| 10 | * The transform method required by Fractal to parse the data and return proper typing and fields. |
|
| 11 | * |
|
| 12 | * @param array $data Data to transform |
|
| 13 | * |
|
| 14 | * @return array |
|
| 15 | */ |
|
| 16 | public function transform($data) |
|
| 17 | { |
|
| 18 | return [ |
|
| 19 | 'id' => (string) $data['outfitID'], |
|
| 20 | 'name' => (string) $data['outfitName'], |
|
| 21 | 'tag' => (string) $data['outfitTag'], |
|
| 22 | 'server' => (int) $data['outfitServer'], |
|
| 23 | 'faction' => (int) $data['outfitFaction'], |
|
| 24 | 'kills' => (int) $data['outfitKills'], |
|
| 25 | 'deaths' => (int) $data['outfitDeaths'], |
|
| 26 | 'teamkills' => (int) $data['outfitTKs'], |
|
| 27 | 'suicides' => (int) $data['outfitSuicides'], |
|
| 28 | 'captures' => (int) $data['outfitCaptures'] |
|
| 29 | ]; |
|
| 30 | } |
|
| 31 | } |
|
| 32 | ||
| @@ 7-30 (lines=24) @@ | ||
| 4 | ||
| 5 | use League\Fractal\TransformerAbstract; |
|
| 6 | ||
| 7 | class PlayerOutfitTransformer extends TransformerAbstract |
|
| 8 | { |
|
| 9 | /** |
|
| 10 | * The transform method required by Fractal to parse the data and return proper typing and fields. |
|
| 11 | * |
|
| 12 | * @param array $data Data to transform |
|
| 13 | * |
|
| 14 | * @return array |
|
| 15 | */ |
|
| 16 | public function transform($data) |
|
| 17 | { |
|
| 18 | return [ |
|
| 19 | 'id' => (string) $data['outfitID'], |
|
| 20 | 'name' => (string) $data['outfitName'], |
|
| 21 | 'tag' => (string) $data['outfitTag'], |
|
| 22 | 'faction' => (int) $data['outfitFaction'], |
|
| 23 | 'kills' => (int) $data['outfitKills'], |
|
| 24 | 'deaths' => (int) $data['outfitDeaths'], |
|
| 25 | 'teamkills' => (int) $data['outfitTKs'], |
|
| 26 | 'suicides' => (int) $data['outfitServer'], |
|
| 27 | 'captures' => (int) $data['outfitCaptures'] |
|
| 28 | ]; |
|
| 29 | } |
|
| 30 | } |
|
| 31 | ||
| @@ 7-30 (lines=24) @@ | ||
| 4 | ||
| 5 | use League\Fractal\TransformerAbstract; |
|
| 6 | ||
| 7 | class OutfitSearchTransformer extends TransformerAbstract |
|
| 8 | { |
|
| 9 | /** |
|
| 10 | * The transform method required by Fractal to parse the data and return proper typing and fields. |
|
| 11 | * |
|
| 12 | * @param array $data Data to transform |
|
| 13 | * |
|
| 14 | * @return array |
|
| 15 | */ |
|
| 16 | public function transform($data) |
|
| 17 | { |
|
| 18 | return [ |
|
| 19 | 'id' => (string) $data['outfitID'], // Bigint |
|
| 20 | 'name' => (string) $data['outfitName'], |
|
| 21 | 'tag' => (string) $data['outfitTag'], |
|
| 22 | 'faction' => (int) $data['outfitFaction'], |
|
| 23 | 'server' => (int) $data['outfitServer'], |
|
| 24 | 'kills' => (int) $data['outfitKills'], |
|
| 25 | 'deaths' => (int) $data['outfitDeaths'], |
|
| 26 | 'teamkills' => (int) $data['outfitTKs'], |
|
| 27 | 'suicides' => (int) $data['outfitSuicides'] |
|
| 28 | ]; |
|
| 29 | } |
|
| 30 | } |
|
| 31 | ||