領収証発行サービス
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

47 řádky
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. }