File Source for Hyperlink.php

PHPExcel_Cell

# Source for file Hyperlink.php

Documentation is available at Hyperlink.php

1. <?php
2. /**
3. * PHPExcel
4. *
5. * Copyright (c) 2006 - 2011 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_Cell
23. * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
24. * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
25. * @version 1.7.6, 2011-02-27
26. */
29. /**
30. * PHPExcel_Cell_Hyperlink
31. *
32. * @category PHPExcel
33. * @package PHPExcel_Cell
34. * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
35. */
36. class PHPExcel_Cell_Hyperlink
37. {
38. /**
39. * URL to link the cell to
40. *
41. * @var string
42. */
43. private $_url;
45. /**
46. * Tooltip to display on the hyperlink
47. *
48. * @var string
49. */
50. private $_tooltip;
52. /**
53. * Create a new PHPExcel_Cell_Hyperlink
54. *
55. * @param string $pUrl Url to link the cell to
56. * @param string $pTooltip Tooltip to display on the hyperlink
57. * @throws Exception
58. */
59. public function __construct($pUrl = '', $pTooltip = '')
60. {
61. // Initialise member variables
62. $this->_url = $pUrl;
63. $this->_tooltip = $pTooltip;
64. }
66. /**
67. * Get URL
68. *
69. * @return string
70. */
71. public function getUrl() {
72. return $this->_url;
73. }
75. /**
76. * Set URL
77. *
78. * @param string $value
79. * @return PHPExcel_Cell_Hyperlink
80. */
81. public function setUrl($value = '') {
82. $this->_url = $value;
83. return $this;
84. }
86. /**
87. * Get tooltip
88. *
89. * @return string
90. */
91. public function getTooltip() {
92. return $this->_tooltip;
93. }
95. /**
96. * Set tooltip
97. *
98. * @param string $value
99. * @return PHPExcel_Cell_Hyperlink
100. */
101. public function setTooltip($value = '') {
102. $this->_tooltip = $value;
103. return $this;
104. }
106. /**
107. * Is this hyperlink internal? (to another sheet)
108. *
109. * @return boolean
110. */
111. public function isInternal() {
112. return strpos($this->_url, 'sheet://') !== false;
113. }
115. /**
116. * Get hash code
117. *
118. * @return string Hash code
119. */
120. public function getHashCode() {
121. return md5(
122. $this->_url
123. . $this->_tooltip
124. . __CLASS__
125. );
126. }
127. }

Documentation generated on Sun, 27 Feb 2011 16:32:23 -0800 by phpDocumentor 1.4.3