領収証発行サービス
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

47 linhas
941B

  1. <?php
  2. namespace App\Logic\User;
  3. use App\Codes\UserRole;
  4. use App\Models\Contract;
  5. use App\Models\User;
  6. use LogicException;
  7. class AdminUserManager extends UserManager
  8. {
  9. public function initForCreateAdmin()
  10. {
  11. $this->setUser(null);
  12. $this->initialized = true;
  13. return $this;
  14. }
  15. public function initForModifyAdmin(string|User $userId)
  16. {
  17. $this->setUser($userId);
  18. $this->initialized = true;
  19. return $this;
  20. }
  21. /**
  22. * @override
  23. */
  24. public function initForCreate(string|Contract $contractId)
  25. {
  26. throw new LogicException("不許可な関数アクセス");
  27. }
  28. /**
  29. * @override
  30. */
  31. public function initForModify(string|Contract $contractId, string|User $userId)
  32. {
  33. throw new LogicException("不許可な関数アクセス");
  34. }
  35. protected function role(): UserRole
  36. {
  37. return UserRole::SUPER_ADMIN;
  38. }
  39. }