OptionsPropertyItem.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <?php
  2. /**
  3. * The top-level class of the "Options" subtree of the object-oriented
  4. * properties system (the other subtree is "Plugin").
  5. */
  6. declare(strict_types=1);
  7. namespace PhpMyAdmin\Properties\Options;
  8. use PhpMyAdmin\Properties\PropertyItem;
  9. /**
  10. * Superclass for
  11. * - PhpMyAdmin\Properties\Options\OptionsPropertyOneItem and
  12. * - OptionsProperty Group
  13. */
  14. abstract class OptionsPropertyItem extends PropertyItem
  15. {
  16. /**
  17. * Name
  18. *
  19. * @var string
  20. */
  21. private $name;
  22. /**
  23. * Text
  24. *
  25. * @var string
  26. */
  27. private $text;
  28. /**
  29. * What to force
  30. *
  31. * @var string
  32. */
  33. private $force;
  34. /**
  35. * @param string $name Item name
  36. * @param string $text Item text
  37. */
  38. public function __construct($name = null, $text = null)
  39. {
  40. if ($name) {
  41. $this->name = $name;
  42. }
  43. if (! $text) {
  44. return;
  45. }
  46. $this->text = $text;
  47. }
  48. /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */
  49. /**
  50. * Gets the name
  51. *
  52. * @return string
  53. */
  54. public function getName()
  55. {
  56. return $this->name;
  57. }
  58. /**
  59. * Sets the name
  60. *
  61. * @param string $name name
  62. *
  63. * @return void
  64. */
  65. public function setName($name)
  66. {
  67. $this->name = $name;
  68. }
  69. /**
  70. * Gets the text
  71. *
  72. * @return string
  73. */
  74. public function getText()
  75. {
  76. return $this->text;
  77. }
  78. /**
  79. * Sets the text
  80. *
  81. * @param string $text text
  82. *
  83. * @return void
  84. */
  85. public function setText($text)
  86. {
  87. $this->text = $text;
  88. }
  89. /**
  90. * Gets the force parameter
  91. *
  92. * @return string
  93. */
  94. public function getForce()
  95. {
  96. return $this->force;
  97. }
  98. /**
  99. * Sets the force parameter
  100. *
  101. * @param string $force force parameter
  102. *
  103. * @return void
  104. */
  105. public function setForce($force)
  106. {
  107. $this->force = $force;
  108. }
  109. /**
  110. * Returns the property type ( either "options", or "plugin" ).
  111. *
  112. * @return string
  113. */
  114. public function getPropertyType()
  115. {
  116. return 'options';
  117. }
  118. }