major update
This commit is contained in:
57
lib/Service/Auth/AuthRepositoryFactory.php
Normal file
57
lib/Service/Auth/AuthRepositoryFactory.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace MintyPHP\Service\Auth;
|
||||
|
||||
use MintyPHP\Repository\Auth\ApiTokenRepository;
|
||||
use MintyPHP\Repository\Auth\EmailVerificationRepository;
|
||||
use MintyPHP\Repository\Auth\PasswordResetRepository;
|
||||
use MintyPHP\Repository\Auth\RememberTokenRepository;
|
||||
use MintyPHP\Repository\Tenant\TenantMicrosoftAuthRepository;
|
||||
use MintyPHP\Repository\Tenant\TenantRepository;
|
||||
use MintyPHP\Repository\User\UserExternalIdentityRepository;
|
||||
|
||||
class AuthRepositoryFactory
|
||||
{
|
||||
private ?ApiTokenRepository $apiTokenRepository = null;
|
||||
private ?RememberTokenRepository $rememberTokenRepository = null;
|
||||
private ?PasswordResetRepository $passwordResetRepository = null;
|
||||
private ?EmailVerificationRepository $emailVerificationRepository = null;
|
||||
private ?TenantRepository $tenantRepository = null;
|
||||
private ?TenantMicrosoftAuthRepository $tenantMicrosoftAuthRepository = null;
|
||||
private ?UserExternalIdentityRepository $userExternalIdentityRepository = null;
|
||||
|
||||
public function createApiTokenRepository(): ApiTokenRepository
|
||||
{
|
||||
return $this->apiTokenRepository ??= new ApiTokenRepository();
|
||||
}
|
||||
|
||||
public function createRememberTokenRepository(): RememberTokenRepository
|
||||
{
|
||||
return $this->rememberTokenRepository ??= new RememberTokenRepository();
|
||||
}
|
||||
|
||||
public function createPasswordResetRepository(): PasswordResetRepository
|
||||
{
|
||||
return $this->passwordResetRepository ??= new PasswordResetRepository();
|
||||
}
|
||||
|
||||
public function createEmailVerificationRepository(): EmailVerificationRepository
|
||||
{
|
||||
return $this->emailVerificationRepository ??= new EmailVerificationRepository();
|
||||
}
|
||||
|
||||
public function createTenantRepository(): TenantRepository
|
||||
{
|
||||
return $this->tenantRepository ??= new TenantRepository();
|
||||
}
|
||||
|
||||
public function createTenantMicrosoftAuthRepository(): TenantMicrosoftAuthRepository
|
||||
{
|
||||
return $this->tenantMicrosoftAuthRepository ??= new TenantMicrosoftAuthRepository();
|
||||
}
|
||||
|
||||
public function createUserExternalIdentityRepository(): UserExternalIdentityRepository
|
||||
{
|
||||
return $this->userExternalIdentityRepository ??= new UserExternalIdentityRepository();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user