| @@ 11-46 (lines=36) @@ | ||
| 8 | use Psr\Http\Message\ServerRequestInterface; |
|
| 9 | use Psr\Http\Message\ResponseInterface; |
|
| 10 | ||
| 11 | class OutfitProfileEndpointController extends AbstractEndpointController |
|
| 12 | { |
|
| 13 | /** |
|
| 14 | * Construct |
|
| 15 | * |
|
| 16 | * @param OutfitTotalRepository $outfitTotalRepo |
|
| 17 | * @param OutfitProfileTransformer $outfitProfileTransformer |
|
| 18 | */ |
|
| 19 | public function __construct( |
|
| 20 | OutfitTotalRepository $outfitTotalRepo, |
|
| 21 | OutfitProfileTransformer $outfitProfileTransformer |
|
| 22 | ) { |
|
| 23 | $this->repository = $outfitTotalRepo; |
|
| 24 | $this->transformer = $outfitProfileTransformer; |
|
| 25 | } |
|
| 26 | ||
| 27 | /** |
|
| 28 | * Gets a outfit |
|
| 29 | * |
|
| 30 | * @param ServerRequestInterface $request |
|
| 31 | * @param ResponseInterface $response |
|
| 32 | * @param array $args |
|
| 33 | * |
|
| 34 | * @return ResponseInterface |
|
| 35 | */ |
|
| 36 | public function getOutfit(ServerRequestInterface $request, ResponseInterface $response, array $args) |
|
| 37 | { |
|
| 38 | $outfit = $this->repository->readSinglebyId($args['id']); |
|
| 39 | ||
| 40 | return $this->respond( |
|
| 41 | 'item', |
|
| 42 | $outfit, |
|
| 43 | $this->transformer |
|
| 44 | ); |
|
| 45 | } |
|
| 46 | } |
|
| 47 | ||
| @@ 11-46 (lines=36) @@ | ||
| 8 | use Psr\Http\Message\ServerRequestInterface; |
|
| 9 | use Psr\Http\Message\ResponseInterface; |
|
| 10 | ||
| 11 | class PlayerProfileEndpointController extends AbstractEndpointController |
|
| 12 | { |
|
| 13 | /** |
|
| 14 | * Construct |
|
| 15 | * |
|
| 16 | * @param PlayerTotalRepository $playerTotalRepo |
|
| 17 | * @param PlayerProfileTransformer $playerProfileTransformer |
|
| 18 | */ |
|
| 19 | public function __construct( |
|
| 20 | PlayerTotalRepository $playerTotalRepo, |
|
| 21 | PlayerProfileTransformer $playerProfileTransformer |
|
| 22 | ) { |
|
| 23 | $this->repository = $playerTotalRepo; |
|
| 24 | $this->transformer = $playerProfileTransformer; |
|
| 25 | } |
|
| 26 | ||
| 27 | /** |
|
| 28 | * Gets a player |
|
| 29 | * |
|
| 30 | * @param ServerRequestInterface $request |
|
| 31 | * @param ResponseInterface $response |
|
| 32 | * @param array $args |
|
| 33 | * |
|
| 34 | * @return ResponseInterface |
|
| 35 | */ |
|
| 36 | public function getPlayer(ServerRequestInterface $request, ResponseInterface $response, array $args) |
|
| 37 | { |
|
| 38 | $player = $this->repository->readSinglebyId($args['id']); |
|
| 39 | ||
| 40 | return $this->respond( |
|
| 41 | 'item', |
|
| 42 | $player, |
|
| 43 | $this->transformer |
|
| 44 | ); |
|
| 45 | } |
|
| 46 | } |
|
| 47 | ||