OptionsPropertyItem.php 2.3 KB

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