mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-22 10:08:45 +02:00
N°8772 - Sub-forms WIP
This commit is contained in:
@@ -53,8 +53,11 @@ abstract class AbstractFormBlock
|
||||
$this->InitInputs();
|
||||
$this->InitOutputs();
|
||||
$this->aOptions = array_merge($this->aOptions, $this->InitOptions());
|
||||
$this->BuildForm();
|
||||
}
|
||||
|
||||
abstract protected function BuildForm();
|
||||
|
||||
/**
|
||||
* Return the form block name.
|
||||
*
|
||||
@@ -65,6 +68,17 @@ abstract class AbstractFormBlock
|
||||
return $this->sName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the form block options.
|
||||
* Options will be passed to FormType for building.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function GetOptions(): array
|
||||
{
|
||||
return $this->aOptions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the form block options.
|
||||
* Options will be passed to FormType for building.
|
||||
@@ -183,6 +197,15 @@ abstract class AbstractFormBlock
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function DependsOnParent(string $sInputName, FormBlock $oParentBlock, string $sParentInputName): AbstractFormBlock
|
||||
{
|
||||
$oFormInput = $this->GetInput($sInputName);
|
||||
$oParentFormInput = $oParentBlock->GetInput($sParentInputName);
|
||||
$oFormInput->Bind($oParentFormInput);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function HasConnections(): bool
|
||||
{
|
||||
foreach ($this->aFormInputs as $oFormInput) {
|
||||
|
||||
Reference in New Issue
Block a user