No puede seleccionar más de 25 temas
Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
|
- <?php
-
- namespace App\Logic\User;
-
- use App\Codes\UserRole;
- use App\Models\Contract;
- use App\Models\User;
- use LogicException;
-
- class AdminUserManager extends UserManager
- {
- /**
- * @override
- */
- public function initForCreateAdmin(): static
- {
- $this->setUser(null);
- $this->initialized = true;
- return $this;
- }
-
- /**
- * @override
- */
- public function initForModifyAdmin(string|User $userId): static
- {
- $this->setUser($userId);
- $this->initialized = true;
- return $this;
- }
-
- /**
- * @override
- */
- public function initForCreate(string|Contract $contractId): static
- {
- throw new LogicException("不許可な関数アクセス");
- }
-
- /**
- * @override
- */
- public function initForModify(string|Contract $contractId, string|User $userId): static
- {
- throw new LogicException("不許可な関数アクセス");
- }
-
- protected function role(): UserRole
- {
- return UserRole::SUPER_ADMIN;
- }
- }
|