getAttribute('id'); $data = []; if ($id) { $cmd = new ReadAssistantCommand($id); try { $assistant = $this->dispatcher->dispatch($cmd); } catch (UserNotFoundException $th) { return new RedirectResponse('/admin/users'); } $data['assistant'] = new AssistantResource($assistant); } return new ViewResponse( '/templates/admin/assistant.twig', $data ); } }