Prerequisites for custom fields

SVN:trunk[3913]
This commit is contained in:
Romain Quetiez
2016-02-19 08:49:14 +00:00
parent e0fad5e0e6
commit 21f0adb41b
13 changed files with 827 additions and 287 deletions

View File

@@ -60,6 +60,25 @@ class Form
return $this->aDependencies;
}
public function GetCurrentValues()
{
$aValues = array();
foreach ($this->aFields as $sId => $oField)
{
$aValues[$sId] = $oField->GetCurrentValue();
}
return $aValues;
}
public function SetCurrentValues($aValues)
{
foreach ($aValues as $sId => $value)
{
$oField = $this->GetField($sId);
$oField->SetCurrentValue($value);
}
}
/**
* Returns the current validation state of the form (true|false).
* It DOESN'T make the validation, see Validate() instead.
@@ -154,6 +173,7 @@ class Form
public function AddField(Field $oField, $aDependsOnIds = array())
{
$oField->SetFormPath($this->sId);
$this->aFields[$oField->GetId()] = $oField;
return $this;
}