mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-04 16:08:44 +02:00
N°8772 - Form dependencies manager implementation - WIP
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user