mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-21 01:28:47 +02:00
N°8771 - Add Symfony form component to iTop core
- WIP
This commit is contained in:
57
sources/Forms/Block/AbstractFormBlock.php
Normal file
57
sources/Forms/Block/AbstractFormBlock.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace Combodo\iTop\Forms\Block;
|
||||
|
||||
abstract class AbstractFormBlock
|
||||
{
|
||||
|
||||
private array $aOptions = [];
|
||||
|
||||
private array $aSubFormBlocks = [];
|
||||
|
||||
private array $aFormInputs = [];
|
||||
|
||||
private array $aFormOutputs = [];
|
||||
|
||||
public function __construct(array $aOptions = [])
|
||||
{
|
||||
$this->aOptions = $aOptions;
|
||||
}
|
||||
|
||||
public function GetOptions(): array
|
||||
{
|
||||
return $this->aOptions;
|
||||
}
|
||||
|
||||
public function AddSubFormBlock(AbstractFormBlock $oSubFormBlock): void
|
||||
{
|
||||
$this->aSubFormBlocks[] = $oSubFormBlock;
|
||||
}
|
||||
|
||||
public function GetSubFormBlocks(): array
|
||||
{
|
||||
return $this->aSubFormBlocks;
|
||||
}
|
||||
|
||||
public function AddInput(FormInput $oFormInput): void
|
||||
{
|
||||
$this->aFormInputs[$oFormInput->GetName()] = $oFormInput;
|
||||
}
|
||||
|
||||
public function GetInput(string $sName): FormInput
|
||||
{
|
||||
return $this->aFormInputs[$sName];
|
||||
}
|
||||
|
||||
public function AddOutput(FormOutput $oFormOutput): void
|
||||
{
|
||||
$this->aFormOutputs[$oFormOutput->GetName()] = $oFormOutput;
|
||||
}
|
||||
|
||||
public function GetOutput(string $sName): FormOutput
|
||||
{
|
||||
return $this->aFormOutputs[$sName];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user