| Total Complexity | 5 |
| Total Lines | 77 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 5 | abstract class FieldWithOptions extends TwillFormComponent |
||
| 6 | { |
||
| 7 | public $options; |
||
| 8 | public $unpack; |
||
| 9 | public $columns; |
||
| 10 | public $searchable; |
||
| 11 | public $note; |
||
| 12 | public $placeholder; |
||
| 13 | public $disabled; |
||
| 14 | public $addNew; |
||
| 15 | public $moduleName; |
||
| 16 | public $storeUrl; |
||
| 17 | public $required; |
||
| 18 | public $fieldsInModal; |
||
| 19 | public $default; |
||
| 20 | /** Below are unused but needed to keep compatible */ |
||
| 21 | public $confirmMessageText; |
||
| 22 | public $confirmTitleText; |
||
| 23 | public $requireConfirmation; |
||
| 24 | |||
| 25 | public function __construct( |
||
| 26 | $name, |
||
| 27 | $label, |
||
| 28 | $renderForBlocks = false, |
||
| 29 | $renderForModal = false, |
||
| 30 | $options = [], |
||
| 31 | $unpack = false, |
||
| 32 | $columns = 0, |
||
| 33 | $searchable = false, |
||
| 34 | $note = null, |
||
| 35 | $placeholder = null, |
||
| 36 | $disabled = false, |
||
| 37 | $addNew = false, |
||
| 38 | $moduleName = null, |
||
| 39 | $storeUrl = null, |
||
| 40 | $default = null, |
||
| 41 | $fieldsInModal = false |
||
| 42 | ) { |
||
| 43 | parent::__construct( |
||
| 44 | $name, |
||
| 45 | $label, |
||
| 46 | $renderForBlocks, |
||
| 47 | $renderForModal |
||
| 48 | ); |
||
| 49 | |||
| 50 | $this->options = $options; |
||
| 51 | $this->unpack = $unpack; |
||
| 52 | $this->columns = $columns; |
||
| 53 | $this->searchable = $searchable; |
||
| 54 | $this->note = $note; |
||
| 55 | $this->placeholder = $placeholder; |
||
| 56 | $this->disabled = $disabled; |
||
| 57 | $this->addNew = $addNew; |
||
| 58 | $this->default = $default; |
||
| 59 | $this->moduleName = $moduleName; |
||
| 60 | $this->storeUrl = $storeUrl; |
||
| 61 | $this->fieldsInModal = $fieldsInModal; |
||
| 62 | |||
| 63 | $this->confirmMessageText = null; |
||
| 64 | $this->confirmTitleText = null; |
||
| 65 | $this->requireConfirmation = null; |
||
| 66 | } |
||
| 67 | |||
| 68 | public function isInModal(): bool { |
||
| 69 | return $this->fieldsInModal ?? false; |
||
| 70 | } |
||
| 71 | |||
| 72 | public function getOptions(): array |
||
| 82 | } |
||
| 83 | } |
||
| 84 |