| Total Complexity | 4 |
| Total Lines | 43 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | abstract class AbstractFormData implements FormDataInterface |
||
| 12 | { |
||
| 13 | /** @var array containing all data that can be edited by the form */ |
||
| 14 | protected array $aValues; |
||
| 15 | /** @var array containing select list to be displayed by the form */ |
||
| 16 | protected array $aSelectOptions; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * (non-PHPdoc) |
||
| 20 | * @see \SKien\Formgenerator\FormDataInterface::getValue() |
||
| 21 | */ |
||
| 22 | public function getValue(string $strName) |
||
| 23 | { |
||
| 24 | return $this->aValues[$strName] ?? ''; |
||
| 25 | } |
||
| 26 | |||
| 27 | /** |
||
| 28 | * (non-PHPdoc) |
||
| 29 | * @see \SKien\Formgenerator\FormDataInterface::getSelectOptions() |
||
| 30 | */ |
||
| 31 | public function getSelectOptions(string $strName) : array |
||
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Set value for specified element. |
||
| 38 | * @param string $strName |
||
| 39 | * @param mixed $value |
||
| 40 | */ |
||
| 41 | public function setValue(string $strName, $value) : void |
||
| 42 | { |
||
| 43 | $this->aValues[$strName] = $value; |
||
| 44 | } |
||
| 45 | |||
| 46 | /** |
||
| 47 | * Set selections for specified elemnt |
||
| 48 | * @param string $strName |
||
| 49 | * @param array $aOptions |
||
| 50 | */ |
||
| 51 | public function setSelectOptions(string $strName, array $aOptions) : void |
||
| 54 | } |
||
| 55 | } |
||
| 56 | |||
| 57 |