getAttribute('id'); $cmd = new ReadPayoutCommand($id); try { /** @var PayoutEntity */ $payout = $this->dispatcher->dispatch($cmd); } catch (PayoutNotFoundException) { return new RedirectResponse('/admin/payouts'); } return new ViewResponse( '/templates/admin/payout.twig', ['payout' => new PayoutResource($payout, ['affiliate', 'affiliate.user'])] ); } }