Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

AbstractSettingDetail.php 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <?php
  2. namespace domain\Setting\SettingDetails;
  3. class AbstractSettingDetail
  4. {
  5. public string $name;
  6. public string $label;
  7. public string $type;
  8. public string $section;
  9. public ?string $formType = null;
  10. public array $options = [];
  11. public $defaultValue = null;
  12. public ?string $subSection = null;
  13. public ?string $helpMessage = null;
  14. public function setName(string $name): self
  15. {
  16. $this->name = $name;
  17. return $this;
  18. }
  19. public function getName(): string
  20. {
  21. return $this->name;
  22. }
  23. public function setLabel(string $label): self
  24. {
  25. $this->label = $label;
  26. return $this;
  27. }
  28. public function getLabel(): string
  29. {
  30. return $this->label;
  31. }
  32. public function setSection(string $section): self
  33. {
  34. $this->section = $section;
  35. return $this;
  36. }
  37. public function getSection(): string
  38. {
  39. return $this->section;
  40. }
  41. public function setSubSection(string $subSection): self
  42. {
  43. $this->subSection = $subSection;
  44. return $this;
  45. }
  46. public function getSubSection(): ?string
  47. {
  48. return $this->subSection;
  49. }
  50. public function setHelpMessage(string $helpMessage): self
  51. {
  52. $this->helpMessage = $helpMessage;
  53. return $this;
  54. }
  55. public function getHelpMessage(): ?string
  56. {
  57. return $this->helpMessage;
  58. }
  59. public function getFormType(): ?string
  60. {
  61. return $this->formType;
  62. }
  63. public function setFormTypeInput(): self
  64. {
  65. $this->formType = 'input';
  66. return $this;
  67. }
  68. public function setFormTypeTextarea(): self
  69. {
  70. $this->formType = 'textarea';
  71. return $this;
  72. }
  73. public function setFormTypeCheckbox(): self
  74. {
  75. $this->formType = 'checkbox';
  76. return $this;
  77. }
  78. public function setFormTypeToggle(): self
  79. {
  80. $this->formType = 'toggle';
  81. return $this;
  82. }
  83. public function setFormTypeSelect(array $options): self
  84. {
  85. $this->formType = 'select';
  86. $this->options = $options;
  87. return $this;
  88. }
  89. public function getOptions(): array
  90. {
  91. return $this->options;
  92. }
  93. public function setDefaultValue($defaultValue): self
  94. {
  95. $this->defaultValue = $defaultValue;
  96. return $this;
  97. }
  98. public function getDefaultValue()
  99. {
  100. return $this->defaultValue;
  101. }
  102. public function setTypeString(): self
  103. {
  104. $this->type = 'string';
  105. return $this;
  106. }
  107. public function setTypeText(): self
  108. {
  109. $this->type = 'text';
  110. return $this;
  111. }
  112. public function setTypeBoolean(): self
  113. {
  114. $this->type = 'boolean';
  115. return $this;
  116. }
  117. public function setTypeDate(): self
  118. {
  119. $this->type = 'date';
  120. return $this;
  121. }
  122. public function setTypeInteger(): self
  123. {
  124. $this->type = 'integer';
  125. return $this;
  126. }
  127. public function setTypeFloat(): self
  128. {
  129. $this->type = 'float';
  130. return $this;
  131. }
  132. public function setTypeDouble(): self
  133. {
  134. $this->type = 'double';
  135. return $this;
  136. }
  137. public function getType(): string
  138. {
  139. return $this->type;
  140. }
  141. }