2026-03-04 15:56:58 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace MintyPHP\Service\Tenant;
|
|
|
|
|
|
|
|
|
|
use MintyPHP\Repository\Org\DepartmentRepository;
|
2026-03-05 08:26:51 +01:00
|
|
|
use MintyPHP\Repository\Org\DepartmentRepositoryInterface;
|
2026-03-04 15:56:58 +01:00
|
|
|
use MintyPHP\Repository\Tenant\TenantRepository;
|
2026-03-05 08:26:51 +01:00
|
|
|
use MintyPHP\Repository\Tenant\TenantRepositoryInterface;
|
2026-03-04 15:56:58 +01:00
|
|
|
use MintyPHP\Repository\Tenant\UserTenantRepository;
|
2026-03-05 08:26:51 +01:00
|
|
|
use MintyPHP\Repository\Tenant\UserTenantRepositoryInterface;
|
2026-03-04 15:56:58 +01:00
|
|
|
|
|
|
|
|
class TenantRepositoryFactory
|
|
|
|
|
{
|
|
|
|
|
private ?TenantRepository $tenantRepository = null;
|
|
|
|
|
private ?DepartmentRepository $departmentRepository = null;
|
|
|
|
|
private ?UserTenantRepository $userTenantRepository = null;
|
|
|
|
|
|
2026-03-05 08:26:51 +01:00
|
|
|
public function createTenantRepository(): TenantRepositoryInterface
|
2026-03-04 15:56:58 +01:00
|
|
|
{
|
|
|
|
|
return $this->tenantRepository ??= new TenantRepository();
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-05 08:26:51 +01:00
|
|
|
public function createDepartmentRepository(): DepartmentRepositoryInterface
|
2026-03-04 15:56:58 +01:00
|
|
|
{
|
|
|
|
|
return $this->departmentRepository ??= new DepartmentRepository();
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-05 08:26:51 +01:00
|
|
|
public function createUserTenantRepository(): UserTenantRepositoryInterface
|
2026-03-04 15:56:58 +01:00
|
|
|
{
|
|
|
|
|
return $this->userTenantRepository ??= new UserTenantRepository();
|
|
|
|
|
}
|
|
|
|
|
}
|