sName = $sName; $this->sType = $sType; $this->oConverter = $oConverter; } public function GetName(): string { return $this->sName; } public function SetName(string $sName): void { $this->sName = $sName; } public function GetType(): string { return $this->sType; } public function SetType(string $sType): void { $this->sType = $sType; } 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; } public function Value(): mixed { if(array_key_exists(FormEvents::POST_SUBMIT, $this->aValues) ){ return $this->aValues[FormEvents::POST_SUBMIT]; } if(array_key_exists(FormEvents::POST_SET_DATA, $this->aValues) ){ return $this->aValues[FormEvents::POST_SET_DATA]; } return null; } public function HasValue(string $sEventType): bool { return array_key_exists($sEventType, $this->aValues) && $this->aValues[$sEventType] !== null; } public function HasValues(): bool { return count($this->aValues) > 0; } public function GetValues(): array { return $this->aValues; } }