| Total Complexity | 6 |
| Total Lines | 61 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | abstract class AbstractFormData implements FormDataInterface |
||
| 10 | { |
||
| 11 | protected array $aValues; |
||
| 12 | protected array $aSelectOptions; |
||
| 13 | protected array $aBtnValues; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * (non-PHPdoc) |
||
| 17 | * @see \SKien\Formgenerator\FormDataInterface::getValue() |
||
| 18 | */ |
||
| 19 | public function getValue(string $strName) |
||
| 20 | { |
||
| 21 | return $this->aValues[$strName] ?? ''; |
||
| 22 | } |
||
| 23 | |||
| 24 | /** |
||
| 25 | * (non-PHPdoc) |
||
| 26 | * @see \SKien\Formgenerator\FormDataInterface::getSelectOptions() |
||
| 27 | */ |
||
| 28 | public function getSelectOptions(string $strName) : array |
||
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * (non-PHPdoc) |
||
| 35 | * @see \SKien\Formgenerator\FormDataInterface::getSelectOptions() |
||
| 36 | */ |
||
| 37 | public function getBtnValue(string $strName) : string |
||
| 38 | { |
||
| 39 | return $this->aBtnValues[$strName] ?? ''; |
||
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * Set value for specified element. |
||
| 44 | * @param string $strName |
||
| 45 | * @param mixed $value |
||
| 46 | */ |
||
| 47 | public function setValue(string $strName, $value) : void |
||
| 48 | { |
||
| 49 | $this->aValues[$strName] = $value; |
||
| 50 | } |
||
| 51 | |||
| 52 | /** |
||
| 53 | * Set selectiptions for specified elemnt |
||
| 54 | * @param string $strName |
||
| 55 | * @param array $aOptions |
||
| 56 | */ |
||
| 57 | public function setSelectOptions(string $strName, array $aOptions) : void |
||
| 58 | { |
||
| 59 | $this->aSelectOptions[$strName] = $aOptions; |
||
| 60 | } |
||
| 61 | |||
| 62 | /** |
||
| 63 | * Set value for specified element. |
||
| 64 | * @param string $strName |
||
| 65 | * @param mixed $value |
||
| 66 | */ |
||
| 67 | public function setBtnValue(string $strName, $value) : void |
||
| 70 | } |
||
| 71 | } |
||
| 72 | |||
| 73 |