PageRenderTime 27ms CodeModel.GetById 0ms RepoModel.GetById 1ms app.codeStats 0ms

/branches/v1.6.0/Classes/PHPExcel/DocumentProperties.php

#
PHP | 299 lines | 95 code | 30 blank | 174 comment | 4 complexity | b4f44de79074ebbae3741554995a7c49 MD5 | raw file
Possible License(s): AGPL-1.0, LGPL-2.0, LGPL-2.1, GPL-3.0, LGPL-3.0
  1. <?php
  2. /**
  3. * PHPExcel
  4. *
  5. * Copyright (c) 2006 - 2008 PHPExcel
  6. *
  7. * This library is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Lesser General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2.1 of the License, or (at your option) any later version.
  11. *
  12. * This library is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with this library; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  20. *
  21. * @category PHPExcel
  22. * @package PHPExcel
  23. * @copyright Copyright (c) 2006 - 2008 PHPExcel (http://www.codeplex.com/PHPExcel)
  24. * @license http://www.gnu.org/licenses/lgpl.txt LGPL
  25. * @version ##VERSION##, ##DATE##
  26. */
  27. /**
  28. * PHPExcel_DocumentProperties
  29. *
  30. * @category PHPExcel
  31. * @package PHPExcel
  32. * @copyright Copyright (c) 2006 - 2008 PHPExcel (http://www.codeplex.com/PHPExcel)
  33. */
  34. class PHPExcel_DocumentProperties
  35. {
  36. /**
  37. * Creator
  38. *
  39. * @var string
  40. */
  41. private $_creator;
  42. /**
  43. * LastModifiedBy
  44. *
  45. * @var string
  46. */
  47. private $_lastModifiedBy;
  48. /**
  49. * Created
  50. *
  51. * @var datetime
  52. */
  53. private $_created;
  54. /**
  55. * Modified
  56. *
  57. * @var datetime
  58. */
  59. private $_modified;
  60. /**
  61. * Title
  62. *
  63. * @var string
  64. */
  65. private $_title;
  66. /**
  67. * Description
  68. *
  69. * @var string
  70. */
  71. private $_description;
  72. /**
  73. * Subject
  74. *
  75. * @var string
  76. */
  77. private $_subject;
  78. /**
  79. * Keywords
  80. *
  81. * @var string
  82. */
  83. private $_keywords;
  84. /**
  85. * Category
  86. *
  87. * @var string
  88. */
  89. private $_category;
  90. /**
  91. * Create a new PHPExcel_DocumentProperties
  92. */
  93. public function __construct()
  94. {
  95. // Initialise values
  96. $this->_creator = 'Unknown Creator';
  97. $this->_lastModifiedBy = $this->_creator;
  98. $this->_created = time();
  99. $this->_modified = time();
  100. $this->_title = "Untitled Spreadsheet";
  101. $this->_subject = '';
  102. $this->_description = '';
  103. $this->_keywords = '';
  104. $this->_category = '';
  105. }
  106. /**
  107. * Get Creator
  108. *
  109. * @return string
  110. */
  111. public function getCreator() {
  112. return $this->_creator;
  113. }
  114. /**
  115. * Set Creator
  116. *
  117. * @param string $pValue
  118. */
  119. public function setCreator($pValue = '') {
  120. $this->_creator = $pValue;
  121. }
  122. /**
  123. * Get Last Modified By
  124. *
  125. * @return string
  126. */
  127. public function getLastModifiedBy() {
  128. return $this->_lastModifiedBy;
  129. }
  130. /**
  131. * Set Last Modified By
  132. *
  133. * @param string $pValue
  134. */
  135. public function setLastModifiedBy($pValue = '') {
  136. $this->_lastModifiedBy = $pValue;
  137. }
  138. /**
  139. * Get Created
  140. *
  141. * @return datetime
  142. */
  143. public function getCreated() {
  144. return $this->_created;
  145. }
  146. /**
  147. * Set Created
  148. *
  149. * @param datetime $pValue
  150. */
  151. public function setCreated($pValue = null) {
  152. if (is_null($pValue)) {
  153. $pValue = time();
  154. }
  155. $this->_created = $pValue;
  156. }
  157. /**
  158. * Get Modified
  159. *
  160. * @return datetime
  161. */
  162. public function getModified() {
  163. return $this->_modified;
  164. }
  165. /**
  166. * Set Modified
  167. *
  168. * @param datetime $pValue
  169. */
  170. public function setModified($pValue = null) {
  171. if (is_null($pValue)) {
  172. $pValue = time();
  173. }
  174. $this->_modified = $pValue;
  175. }
  176. /**
  177. * Get Title
  178. *
  179. * @return string
  180. */
  181. public function getTitle() {
  182. return $this->_title;
  183. }
  184. /**
  185. * Set Title
  186. *
  187. * @param string $pValue
  188. */
  189. public function setTitle($pValue = '') {
  190. $this->_title = $pValue;
  191. }
  192. /**
  193. * Get Description
  194. *
  195. * @return string
  196. */
  197. public function getDescription() {
  198. return $this->_description;
  199. }
  200. /**
  201. * Set Description
  202. *
  203. * @param string $pValue
  204. */
  205. public function setDescription($pValue = '') {
  206. $this->_description = $pValue;
  207. }
  208. /**
  209. * Get Subject
  210. *
  211. * @return string
  212. */
  213. public function getSubject() {
  214. return $this->_subject;
  215. }
  216. /**
  217. * Set Subject
  218. *
  219. * @param string $pValue
  220. */
  221. public function setSubject($pValue = '') {
  222. $this->_subject = $pValue;
  223. }
  224. /**
  225. * Get Keywords
  226. *
  227. * @return string
  228. */
  229. public function getKeywords() {
  230. return $this->_keywords;
  231. }
  232. /**
  233. * Set Keywords
  234. *
  235. * @param string $pValue
  236. */
  237. public function setKeywords($pValue = '') {
  238. $this->_keywords = $pValue;
  239. }
  240. /**
  241. * Get Category
  242. *
  243. * @return string
  244. */
  245. public function getCategory() {
  246. return $this->_category;
  247. }
  248. /**
  249. * Set Category
  250. *
  251. * @param string $pValue
  252. */
  253. public function setCategory($pValue = '') {
  254. $this->_category = $pValue;
  255. }
  256. /**
  257. * Implement PHP __clone to create a deep clone, not just a shallow copy.
  258. */
  259. public function __clone() {
  260. $vars = get_object_vars($this);
  261. foreach ($vars as $key => $value) {
  262. if (is_object($value)) {
  263. $this->$key = clone $value;
  264. } else {
  265. $this->$key = $value;
  266. }
  267. }
  268. }
  269. }