Няма описание

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <?php
  2. /**
  3. * This file is part of PHPWord - A pure PHP library for reading and writing
  4. * word processing documents.
  5. *
  6. * PHPWord is free software distributed under the terms of the GNU Lesser
  7. * General Public License version 3 as published by the Free Software Foundation.
  8. *
  9. * For the full copyright and license information, please read the LICENSE
  10. * file that was distributed with this source code. For the full list of
  11. * contributors, visit https://github.com/PHPOffice/PHPWord/contributors.
  12. *
  13. * @link https://github.com/PHPOffice/PHPWord
  14. * @copyright 2010-2014 PHPWord contributors
  15. * @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
  16. */
  17. namespace PhpOffice\PhpWord\Element;
  18. /**
  19. * Structured document tag (SDT) element
  20. *
  21. * @since 0.12.0
  22. */
  23. class SDT extends Text
  24. {
  25. /**
  26. * Form field type: comboBox|dropDownList|date
  27. *
  28. * @var string
  29. */
  30. private $type;
  31. /**
  32. * Value
  33. *
  34. * @var string|bool|int
  35. */
  36. private $value;
  37. /**
  38. * CheckBox/DropDown list entries
  39. *
  40. * @var array
  41. */
  42. private $listItems = array();
  43. /**
  44. * Create new instance
  45. *
  46. * @param string $type
  47. * @param mixed $fontStyle
  48. * @param mixed $paragraphStyle
  49. * @return self
  50. */
  51. public function __construct($type, $fontStyle = null, $paragraphStyle = null)
  52. {
  53. $this->setType($type);
  54. }
  55. /**
  56. * Get type
  57. *
  58. * @return string
  59. */
  60. public function getType()
  61. {
  62. return $this->type;
  63. }
  64. /**
  65. * Set type
  66. *
  67. * @param string $value
  68. * @return self
  69. */
  70. public function setType($value)
  71. {
  72. $enum = array('comboBox', 'dropDownList', 'date');
  73. $this->type = $this->setEnumVal($value, $enum, 'comboBox');
  74. return $this;
  75. }
  76. /**
  77. * Get value
  78. *
  79. * @return string|bool|int
  80. */
  81. public function getValue()
  82. {
  83. return $this->value;
  84. }
  85. /**
  86. * Set value
  87. *
  88. * @param string|bool|int $value
  89. * @return self
  90. */
  91. public function setValue($value)
  92. {
  93. $this->value = $value;
  94. return $this;
  95. }
  96. /**
  97. * Get listItems
  98. *
  99. * @return array
  100. */
  101. public function getListItems()
  102. {
  103. return $this->listItems;
  104. }
  105. /**
  106. * Set listItems
  107. *
  108. * @param array $value
  109. * @return self
  110. */
  111. public function setListItems($value)
  112. {
  113. $this->listItems = $value;
  114. return $this;
  115. }
  116. }