N°8772 - Form dependencies manager implementation - WIP

This commit is contained in:
Eric Espie
2025-10-23 16:57:35 +02:00
parent fd449d195d
commit 21b786e0fa
12 changed files with 353 additions and 291 deletions

View File

@@ -11,6 +11,7 @@ class FormOutput
private string $sType;
private null|AbstractConverter $oConverter;
private array $aValues;
public function __construct(string $sName, string $sType, AbstractConverter $oConverter = null)
{
@@ -39,10 +40,23 @@ class FormOutput
$this->sType = $sType;
}
public function GetOutputValue(mixed $oData): mixed
public function ConvertValue(mixed $oData): mixed
{
if (is_null($this->oConverter)) {
return $oData;
}
return $this->oConverter->Convert($oData);
}
public function UpdateOutputValue(mixed $oData, string $sEventType): void
{
$this->aValues[$sEventType] = $this->ConvertValue($oData);
}
public function GetValue(string $sEventType): mixed
{
return $this->aValues[$sEventType] ?? null;
}
}