You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
765B

  1. <?php
  2. namespace domain\User\User;
  3. use domain\_\AbstractManager;
  4. class UserManager extends AbstractManager
  5. {
  6. protected UserBuilder $userBuilder;
  7. protected UserNotifier $userNotifier;
  8. public function loadDependencies(): void
  9. {
  10. $this->userBuilder = $this->loadService(UserBuilder::class);
  11. $this->userNotifier = $this->loadService(UserNotifier::class);
  12. }
  13. public function welcome(User $user)
  14. {
  15. $password = $this->userBuilder->generatePassword($user);
  16. $this->userNotifier->sendMailWelcome($user, $password);
  17. }
  18. public function newPassword(User $user)
  19. {
  20. $password = $this->userBuilder->generatePassword($user);
  21. $this->userNotifier->sendMailNewPassword($user, $password);
  22. }
  23. }