ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
Comment.php
Go to the documentation of this file.
1 <?php
37 {
43  private $_author;
44 
50  private $_text;
51 
57  private $_width = '96pt';
58 
64  private $_marginLeft = '59.25pt';
65 
71  private $_marginTop = '1.5pt';
72 
78  private $_visible = false;
79 
85  private $_height = '55.5pt';
86 
92  private $_fillColor;
93 
99  private $_alignment;
100 
106  public function __construct()
107  {
108  // Initialise variables
109  $this->_author = 'Author';
110  $this->_text = new PHPExcel_RichText();
111  $this->_fillColor = new PHPExcel_Style_Color('FFFFFFE1');
113  }
114 
120  public function getAuthor() {
121  return $this->_author;
122  }
123 
130  public function setAuthor($pValue = '') {
131  $this->_author = $pValue;
132  return $this;
133  }
134 
140  public function getText() {
141  return $this->_text;
142  }
143 
150  public function setText(PHPExcel_RichText $pValue) {
151  $this->_text = $pValue;
152  return $this;
153  }
154 
160  public function getWidth() {
161  return $this->_width;
162  }
163 
170  public function setWidth($value = '96pt') {
171  $this->_width = $value;
172  return $this;
173  }
174 
180  public function getHeight() {
181  return $this->_height;
182  }
183 
190  public function setHeight($value = '55.5pt') {
191  $this->_height = $value;
192  return $this;
193  }
194 
200  public function getMarginLeft() {
201  return $this->_marginLeft;
202  }
203 
210  public function setMarginLeft($value = '59.25pt') {
211  $this->_marginLeft = $value;
212  return $this;
213  }
214 
220  public function getMarginTop() {
221  return $this->_marginTop;
222  }
223 
230  public function setMarginTop($value = '1.5pt') {
231  $this->_marginTop = $value;
232  return $this;
233  }
234 
240  public function getVisible() {
241  return $this->_visible;
242  }
243 
250  public function setVisible($value = false) {
251  $this->_visible = $value;
252  return $this;
253  }
254 
260  public function getFillColor() {
261  return $this->_fillColor;
262  }
263 
271  $this->_alignment = $pValue;
272  return $this;
273  }
274 
280  public function getAlignment() {
281  return $this->_alignment;
282  }
283 
289  public function getHashCode() {
290  return md5(
291  $this->_author
292  . $this->_text->getHashCode()
293  . $this->_width
294  . $this->_height
295  . $this->_marginLeft
296  . $this->_marginTop
297  . ($this->_visible ? 1 : 0)
298  . $this->_fillColor->getHashCode()
299  . $this->_alignment
300  . __CLASS__
301  );
302  }
303 
307  public function __clone() {
308  $vars = get_object_vars($this);
309  foreach ($vars as $key => $value) {
310  if (is_object($value)) {
311  $this->$key = clone $value;
312  } else {
313  $this->$key = $value;
314  }
315  }
316  }
317 
323  public function __toString() {
324  return $this->_text->getPlainText();
325  }
326 
327 }
getText()
Get Rich text comment.
Definition: Comment.php:140
getAlignment()
Get Alignment.
Definition: Comment.php:280
setMarginTop($value='1.5pt')
Set top margin (CSS style, i.e.
Definition: Comment.php:230
__toString()
Convert to string.
Definition: Comment.php:323
__clone()
Implement PHP __clone to create a deep clone, not just a shallow copy.
Definition: Comment.php:307
getVisible()
Is the comment visible by default?
Definition: Comment.php:240
getWidth()
Get comment width (CSS style, i.e.
Definition: Comment.php:160
getFillColor()
Get fill color.
Definition: Comment.php:260
__construct()
Create a new PHPExcel_Comment.
Definition: Comment.php:106
setWidth($value='96pt')
Set comment width (CSS style, i.e.
Definition: Comment.php:170
setVisible($value=false)
Set comment default visibility.
Definition: Comment.php:250
setAlignment($pValue=PHPExcel_Style_Alignment::HORIZONTAL_GENERAL)
Set Alignment.
Definition: Comment.php:270
getMarginLeft()
Get left margin (CSS style, i.e.
Definition: Comment.php:200
getHeight()
Get comment height (CSS style, i.e.
Definition: Comment.php:180
setAuthor($pValue='')
Set Author.
Definition: Comment.php:130
getAuthor()
Get Author.
Definition: Comment.php:120
getHashCode()
Get hash code.
Definition: Comment.php:289
setHeight($value='55.5pt')
Set comment height (CSS style, i.e.
Definition: Comment.php:190
getMarginTop()
Get top margin (CSS style, i.e.
Definition: Comment.php:220
setText(PHPExcel_RichText $pValue)
Set Rich text comment.
Definition: Comment.php:150
$key
Definition: croninfo.php:18
setMarginLeft($value='59.25pt')
Set left margin (CSS style, i.e.
Definition: Comment.php:210