mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 10:38:45 +02:00
N°8772 - dynamic form
This commit is contained in:
60
sources/Forms/IO/FormInput.php
Normal file
60
sources/Forms/IO/FormInput.php
Normal file
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/*
|
||||
* @copyright Copyright (C) 2010-2025 Combodo SARL
|
||||
* @license http://opensource.org/licenses/AGPL-3.0
|
||||
*/
|
||||
|
||||
namespace Combodo\iTop\Forms\IO;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class FormInput extends AbstractFormIO
|
||||
{
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function IsDataReady(): bool
|
||||
{
|
||||
return $this->HasValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $sEventType
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function IsEventDataReady(string $sEventType = null): bool
|
||||
{
|
||||
return $this->HasEventValue($sEventType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the values of the input.
|
||||
*
|
||||
* @param array $aValues
|
||||
*
|
||||
* @return AbstractFormIO
|
||||
*/
|
||||
public function SetValues(array $aValues): AbstractFormIO
|
||||
{
|
||||
parent::SetValues($aValues);
|
||||
|
||||
$this->PropagateBindingsValues();
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Propagate the bindings values.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function PropagateBindingsValues(): void
|
||||
{
|
||||
// propagate the value
|
||||
foreach ($this->aBindingsToInputs as $oBinding) {
|
||||
$oBinding->PropagateValues();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user