OptionsPropertyItem.php 2.2 KB

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