namespace Combodo\iTop\Form\Field; use \Closure; use \Combodo\iTop\Form\Field\Field; use \Combodo\iTop\Form\Form; /** * Description of StringField * * @author Guillaume Lajarige */ class SubFormField extends Field { protected $oForm; public function __construct($sId, $sParentFormId, Closure $onFinalizeCallback = null) { $this->oForm = new \Combodo\iTop\Form\Form($sParentFormId.'-subform_'.$sId); parent::__construct($sId, $onFinalizeCallback); } public function GetForm() { return $this->oForm; } /** * Checks the validators to see if the field's current value is valid. * Then sets $bValid and $aErrorMessages. * * @return boolean */ public function Validate() { $this->oForm->Validate(); } public function GetValid() { return $this->oForm->GetValid(); } public function GetErrorMessages() { return $this->oForm->GetErrorMessages(); } public function GetCurrentValue() { return $this->oForm->GetCurrentValues(); } public function SetCurrentValue($value) { return $this->oForm->SetCurrentValues($value); } }