public function handle($request)
 {
     $member = Member::register($request->name, $request->email, $request->githubUrl, $request->githubId, $request->imageUrl);
     $this->memberRepository->save($member);
     $this->dispatcher->dispatch($member->releaseEvents());
     return new RegisterMemberResponse($member);
 }
Beispiel #2
0
 public function handle($command)
 {
     $problemMember = $this->memberRepository->getById($command->problemMemberId);
     $moderator = $this->memberRepository->getById($command->moderatorId);
     if (!$problemMember || !$moderator) {
         throw new MemberNotFoundException();
     }
     $problemMember->bannedBy($moderator);
     $this->memberRepository->save($problemMember);
 }
 public function handle($request)
 {
     $githubUser = $request->githubUser;
     $member = $this->memberRepository->getByGithubId($githubUser->githubId);
     if (!$member) {
         throw new MemberNotFoundException();
     }
     $member->name = $githubUser->name;
     $member->email = $githubUser->email;
     $member->github_url = $githubUser->githubUrl;
     $member->github_id = $githubUser->githubId;
     $member->image_url = $githubUser->imageUrl;
     $this->memberRepository->save($member);
     return new LoginMemberThroughGithubResponse($member);
 }