/**
  * Handle a command.
  *
  * @param $command
  * @return mixed
  */
 public function handle($command)
 {
     $user = User::register($command->username, $command->email, $command->password);
     $this->repository->save($user);
     $this->dispatcher->dispatch($user->releaseEvents());
     return $user;
 }
 public function handle($command)
 {
     $user = User::register($command->username, $command->email, $command->password);
     //dd($user);
     $this->repository->save($user);
     return $user;
 }
Exemplo n.º 3
0
 public function handle(UserRepository $repository)
 {
     $username = $this->username;
     $email = $this->email;
     $password = $this->password;
     $user = User::register($username, $email, $password);
     $repository->save($user);
     return $user;
 }
 /**
  * Handles the command
  *
  * @param Command $command Command
  *
  * @return User
  * @author Alonzo Tolver
  *
  **/
 public function handle($command)
 {
     /**
      * @var User
      */
     $user = User::register($command->username, $command->email, $command->password);
     $this->repository->save($user);
     $this->dispatchEventsFor($user);
     return $user;
 }
 public function handle($command)
 {
     //register a user
     $user = User::register($command->username, $command->email, $command->password);
     //persist user in the db
     //$user->raise(new UserRegistered);
     $this->repository->save($user);
     //$events = $user->releaseEvents();
     $this->dispatchEventsFor($user);
     return $user;
 }