Files
breadcrumb-the-shire/lib/Service/Tenant/TenantRepositoryFactory.php
2026-03-05 08:26:51 +01:00

33 lines
1.1 KiB
PHP

<?php
namespace MintyPHP\Service\Tenant;
use MintyPHP\Repository\Org\DepartmentRepository;
use MintyPHP\Repository\Org\DepartmentRepositoryInterface;
use MintyPHP\Repository\Tenant\TenantRepository;
use MintyPHP\Repository\Tenant\TenantRepositoryInterface;
use MintyPHP\Repository\Tenant\UserTenantRepository;
use MintyPHP\Repository\Tenant\UserTenantRepositoryInterface;
class TenantRepositoryFactory
{
private ?TenantRepository $tenantRepository = null;
private ?DepartmentRepository $departmentRepository = null;
private ?UserTenantRepository $userTenantRepository = null;
public function createTenantRepository(): TenantRepositoryInterface
{
return $this->tenantRepository ??= new TenantRepository();
}
public function createDepartmentRepository(): DepartmentRepositoryInterface
{
return $this->departmentRepository ??= new DepartmentRepository();
}
public function createUserTenantRepository(): UserTenantRepositoryInterface
{
return $this->userTenantRepository ??= new UserTenantRepository();
}
}