major update
This commit is contained in:
29
lib/Service/Tenant/TenantRepositoryFactory.php
Normal file
29
lib/Service/Tenant/TenantRepositoryFactory.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace MintyPHP\Service\Tenant;
|
||||
|
||||
use MintyPHP\Repository\Org\DepartmentRepository;
|
||||
use MintyPHP\Repository\Tenant\TenantRepository;
|
||||
use MintyPHP\Repository\Tenant\UserTenantRepository;
|
||||
|
||||
class TenantRepositoryFactory
|
||||
{
|
||||
private ?TenantRepository $tenantRepository = null;
|
||||
private ?DepartmentRepository $departmentRepository = null;
|
||||
private ?UserTenantRepository $userTenantRepository = null;
|
||||
|
||||
public function createTenantRepository(): TenantRepository
|
||||
{
|
||||
return $this->tenantRepository ??= new TenantRepository();
|
||||
}
|
||||
|
||||
public function createDepartmentRepository(): DepartmentRepository
|
||||
{
|
||||
return $this->departmentRepository ??= new DepartmentRepository();
|
||||
}
|
||||
|
||||
public function createUserTenantRepository(): UserTenantRepository
|
||||
{
|
||||
return $this->userTenantRepository ??= new UserTenantRepository();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user