2026-03-04 15:56:58 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace MintyPHP\Service\CustomField;
|
|
|
|
|
|
|
|
|
|
use MintyPHP\Repository\Tenant\TenantRepository;
|
2026-03-13 11:31:33 +01:00
|
|
|
use MintyPHP\Service\Tenant\TenantScopeService;
|
2026-03-04 15:56:58 +01:00
|
|
|
|
|
|
|
|
class CustomFieldServicesFactory
|
|
|
|
|
{
|
|
|
|
|
private ?TenantCustomFieldService $tenantCustomFieldService = null;
|
|
|
|
|
private ?UserCustomFieldValueService $userCustomFieldValueService = null;
|
|
|
|
|
|
|
|
|
|
public function __construct(
|
|
|
|
|
private readonly TenantRepository $tenantRepository,
|
2026-03-13 11:31:33 +01:00
|
|
|
private readonly TenantScopeService $userScopeGateway
|
2026-03-04 15:56:58 +01:00
|
|
|
) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function createTenantCustomFieldService(): TenantCustomFieldService
|
|
|
|
|
{
|
|
|
|
|
return $this->tenantCustomFieldService ??= new TenantCustomFieldService($this->tenantRepository);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function createUserCustomFieldValueService(): UserCustomFieldValueService
|
|
|
|
|
{
|
|
|
|
|
return $this->userCustomFieldValueService ??= new UserCustomFieldValueService($this->userScopeGateway);
|
|
|
|
|
}
|
|
|
|
|
}
|