You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

135 lines
2.7KB

  1. <?php
  2. namespace common\logic\Setting\SettingDetails;
  3. class AbstractSettingDetail
  4. {
  5. const TYPE_STRING = 'string';
  6. const TYPE_TEXT = 'text';
  7. const TYPE_BOOLEAN = 'boolean';
  8. const TYPE_DATE = 'date';
  9. const TYPE_INTEGER = 'integer';
  10. const TYPE_FLOAT = 'float';
  11. const TYPE_DOUBLE = 'double';
  12. public string $name;
  13. public string $label;
  14. public string $type;
  15. public string $section;
  16. public $defaultValue = null;
  17. public ?string $subSection = null;
  18. public ?string $helpMessage = null;
  19. public function setName(string $name): self
  20. {
  21. $this->name = $name;
  22. return $this;
  23. }
  24. public function getName(): string
  25. {
  26. return $this->name;
  27. }
  28. public function setLabel(string $label): self
  29. {
  30. $this->label = $label;
  31. return $this;
  32. }
  33. public function getLabel(): string
  34. {
  35. return $this->label;
  36. }
  37. public function setSection(string $section): self
  38. {
  39. $this->section = $section;
  40. return $this;
  41. }
  42. public function getSection(): string
  43. {
  44. return $this->section;
  45. }
  46. public function setSubSection(string $subSection): self
  47. {
  48. $this->subSection = $subSection;
  49. return $this;
  50. }
  51. public function getSubSection(): ?string
  52. {
  53. return $this->subSection;
  54. }
  55. public function setHelpMessage(string $helpMessage): self
  56. {
  57. $this->helpMessage = $helpMessage;
  58. return $this;
  59. }
  60. public function getHelpMessage(): ?string
  61. {
  62. return $this->helpMessage;
  63. }
  64. public function setDefaultValue($defaultValue): self
  65. {
  66. $this->defaultValue = $defaultValue;
  67. return $this;
  68. }
  69. public function getDefaultValue()
  70. {
  71. return $this->defaultValue;
  72. }
  73. public function setTypeString(): self
  74. {
  75. $this->type = self::TYPE_STRING;
  76. return $this;
  77. }
  78. public function setTypeText(): self
  79. {
  80. $this->type = self::TYPE_TEXT;
  81. return $this;
  82. }
  83. public function setTypeBoolean(): self
  84. {
  85. $this->type = self::TYPE_BOOLEAN;
  86. return $this;
  87. }
  88. public function setTypeDate(): self
  89. {
  90. $this->type = self::TYPE_DATE;
  91. return $this;
  92. }
  93. public function setTypeInteger(): self
  94. {
  95. $this->type = self::TYPE_INTEGER;
  96. return $this;
  97. }
  98. public function setTypeFloat(): self
  99. {
  100. $this->type = self::TYPE_FLOAT;
  101. return $this;
  102. }
  103. public function setTypeDouble(): self
  104. {
  105. $this->type = self::TYPE_DOUBLE;
  106. return $this;
  107. }
  108. public function getType(): string
  109. {
  110. return $this->type;
  111. }
  112. }