ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
PhpOffice\PhpSpreadsheet\Comment Class Reference
+ Inheritance diagram for PhpOffice\PhpSpreadsheet\Comment:
+ Collaboration diagram for PhpOffice\PhpSpreadsheet\Comment:

Public Member Functions

 __construct ()
 Create a new Comment. More...
 
 getAuthor ()
 Get Author. More...
 
 setAuthor ($author)
 Set Author. More...
 
 getText ()
 Get Rich text comment. More...
 
 setText (RichText $pValue)
 Set Rich text comment. More...
 
 getWidth ()
 Get comment width (CSS style, i.e. More...
 
 setWidth ($width)
 Set comment width (CSS style, i.e. More...
 
 getHeight ()
 Get comment height (CSS style, i.e. More...
 
 setHeight ($value)
 Set comment height (CSS style, i.e. More...
 
 getMarginLeft ()
 Get left margin (CSS style, i.e. More...
 
 setMarginLeft ($value)
 Set left margin (CSS style, i.e. More...
 
 getMarginTop ()
 Get top margin (CSS style, i.e. More...
 
 setMarginTop ($value)
 Set top margin (CSS style, i.e. More...
 
 getVisible ()
 Is the comment visible by default? More...
 
 setVisible ($value)
 Set comment default visibility. More...
 
 getFillColor ()
 Get fill color. More...
 
 setAlignment ($alignment)
 Set Alignment. More...
 
 getAlignment ()
 Get Alignment. More...
 
 getHashCode ()
 Get hash code. More...
 
 __clone ()
 Implement PHP __clone to create a deep clone, not just a shallow copy. More...
 
 __toString ()
 Convert to string. More...
 
 getHashCode ()
 Get hash code. More...
 

Private Attributes

 $author
 
 $text
 
 $width = '96pt'
 
 $marginLeft = '59.25pt'
 
 $marginTop = '1.5pt'
 
 $visible = false
 
 $height = '55.5pt'
 
 $fillColor
 
 $alignment
 

Detailed Description

Definition at line 7 of file Comment.php.

Constructor & Destructor Documentation

◆ __construct()

PhpOffice\PhpSpreadsheet\Comment::__construct ( )

Create a new Comment.

Definition at line 75 of file Comment.php.

76 {
77 // Initialise variables
78 $this->author = 'Author';
79 $this->text = new RichText();
80 $this->fillColor = new Style\Color('FFFFFFE1');
81 $this->alignment = Style\Alignment::HORIZONTAL_GENERAL;
82 }

References PhpOffice\PhpSpreadsheet\Style\Alignment\HORIZONTAL_GENERAL.

Member Function Documentation

◆ __clone()

PhpOffice\PhpSpreadsheet\Comment::__clone ( )

Implement PHP __clone to create a deep clone, not just a shallow copy.

Definition at line 308 of file Comment.php.

309 {
310 $vars = get_object_vars($this);
311 foreach ($vars as $key => $value) {
312 if (is_object($value)) {
313 $this->$key = clone $value;
314 } else {
315 $this->$key = $value;
316 }
317 }
318 }
$key
Definition: croninfo.php:18

References $key.

◆ __toString()

PhpOffice\PhpSpreadsheet\Comment::__toString ( )

Convert to string.

Returns
string

Definition at line 325 of file Comment.php.

326 {
327 return $this->text->getPlainText();
328 }

◆ getAlignment()

PhpOffice\PhpSpreadsheet\Comment::getAlignment ( )

Get Alignment.

Returns
string

Definition at line 279 of file Comment.php.

280 {
281 return $this->alignment;
282 }

References PhpOffice\PhpSpreadsheet\Comment\$alignment.

◆ getAuthor()

PhpOffice\PhpSpreadsheet\Comment::getAuthor ( )

Get Author.

Returns
string

Definition at line 89 of file Comment.php.

References PhpOffice\PhpSpreadsheet\Comment\$author.

Referenced by PhpOffice\PhpSpreadsheet\Writer\Xlsx\Comments\writeComment().

+ Here is the caller graph for this function:

◆ getFillColor()

PhpOffice\PhpSpreadsheet\Comment::getFillColor ( )

Get fill color.

Returns
Style\Color

Definition at line 255 of file Comment.php.

256 {
257 return $this->fillColor;
258 }

References PhpOffice\PhpSpreadsheet\Comment\$fillColor.

Referenced by PhpOffice\PhpSpreadsheet\Writer\Xlsx\Comments\writeVMLComment().

+ Here is the caller graph for this function:

◆ getHashCode()

PhpOffice\PhpSpreadsheet\Comment::getHashCode ( )

Get hash code.

Returns
string Hash code

Implements PhpOffice\PhpSpreadsheet\IComparable.

Definition at line 289 of file Comment.php.

290 {
291 return md5(
292 $this->author .
293 $this->text->getHashCode() .
294 $this->width .
295 $this->height .
296 $this->marginLeft .
297 $this->marginTop .
298 ($this->visible ? 1 : 0) .
299 $this->fillColor->getHashCode() .
300 $this->alignment .
301 __CLASS__
302 );
303 }

◆ getHeight()

PhpOffice\PhpSpreadsheet\Comment::getHeight ( )

Get comment height (CSS style, i.e.

XXpx or YYpt).

Returns
string

Definition at line 159 of file Comment.php.

160 {
161 return $this->height;
162 }

References PhpOffice\PhpSpreadsheet\Comment\$height.

Referenced by PhpOffice\PhpSpreadsheet\Writer\Xlsx\Comments\writeVMLComment().

+ Here is the caller graph for this function:

◆ getMarginLeft()

PhpOffice\PhpSpreadsheet\Comment::getMarginLeft ( )

Get left margin (CSS style, i.e.

XXpx or YYpt).

Returns
string

Definition at line 183 of file Comment.php.

184 {
185 return $this->marginLeft;
186 }

References PhpOffice\PhpSpreadsheet\Comment\$marginLeft.

Referenced by PhpOffice\PhpSpreadsheet\Writer\Xlsx\Comments\writeVMLComment().

+ Here is the caller graph for this function:

◆ getMarginTop()

PhpOffice\PhpSpreadsheet\Comment::getMarginTop ( )

Get top margin (CSS style, i.e.

XXpx or YYpt).

Returns
string

Definition at line 207 of file Comment.php.

208 {
209 return $this->marginTop;
210 }

References PhpOffice\PhpSpreadsheet\Comment\$marginTop.

Referenced by PhpOffice\PhpSpreadsheet\Writer\Xlsx\Comments\writeVMLComment().

+ Here is the caller graph for this function:

◆ getText()

PhpOffice\PhpSpreadsheet\Comment::getText ( )

Get Rich text comment.

Returns
RichText

Definition at line 113 of file Comment.php.

114 {
115 return $this->text;
116 }

References PhpOffice\PhpSpreadsheet\Comment\$text.

Referenced by PhpOffice\PhpSpreadsheet\Writer\Xlsx\Comments\writeComment().

+ Here is the caller graph for this function:

◆ getVisible()

PhpOffice\PhpSpreadsheet\Comment::getVisible ( )

Is the comment visible by default?

Returns
bool

Definition at line 231 of file Comment.php.

232 {
233 return $this->visible;
234 }

References PhpOffice\PhpSpreadsheet\Comment\$visible.

Referenced by PhpOffice\PhpSpreadsheet\Writer\Xlsx\Comments\writeVMLComment().

+ Here is the caller graph for this function:

◆ getWidth()

PhpOffice\PhpSpreadsheet\Comment::getWidth ( )

Get comment width (CSS style, i.e.

XXpx or YYpt).

Returns
string

Definition at line 135 of file Comment.php.

136 {
137 return $this->width;
138 }

References PhpOffice\PhpSpreadsheet\Comment\$width.

Referenced by PhpOffice\PhpSpreadsheet\Writer\Xlsx\Comments\writeVMLComment().

+ Here is the caller graph for this function:

◆ setAlignment()

PhpOffice\PhpSpreadsheet\Comment::setAlignment (   $alignment)

Set Alignment.

Parameters
string$alignmentsee Style\Alignment::HORIZONTAL_*
Returns
$this

Definition at line 267 of file Comment.php.

268 {
269 $this->alignment = $alignment;
270
271 return $this;
272 }

References PhpOffice\PhpSpreadsheet\Comment\$alignment.

◆ setAuthor()

PhpOffice\PhpSpreadsheet\Comment::setAuthor (   $author)

Set Author.

Parameters
string$author
Returns
$this

Definition at line 101 of file Comment.php.

102 {
103 $this->author = $author;
104
105 return $this;
106 }

References PhpOffice\PhpSpreadsheet\Comment\$author.

◆ setHeight()

PhpOffice\PhpSpreadsheet\Comment::setHeight (   $value)

Set comment height (CSS style, i.e.

XXpx or YYpt).

Parameters
string$value
Returns
$this

Definition at line 171 of file Comment.php.

172 {
173 $this->height = $value;
174
175 return $this;
176 }

◆ setMarginLeft()

PhpOffice\PhpSpreadsheet\Comment::setMarginLeft (   $value)

Set left margin (CSS style, i.e.

XXpx or YYpt).

Parameters
string$value
Returns
$this

Definition at line 195 of file Comment.php.

196 {
197 $this->marginLeft = $value;
198
199 return $this;
200 }

◆ setMarginTop()

PhpOffice\PhpSpreadsheet\Comment::setMarginTop (   $value)

Set top margin (CSS style, i.e.

XXpx or YYpt).

Parameters
string$value
Returns
$this

Definition at line 219 of file Comment.php.

220 {
221 $this->marginTop = $value;
222
223 return $this;
224 }

◆ setText()

PhpOffice\PhpSpreadsheet\Comment::setText ( RichText  $pValue)

Set Rich text comment.

Returns
$this

Definition at line 123 of file Comment.php.

124 {
125 $this->text = $pValue;
126
127 return $this;
128 }

◆ setVisible()

PhpOffice\PhpSpreadsheet\Comment::setVisible (   $value)

Set comment default visibility.

Parameters
bool$value
Returns
$this

Definition at line 243 of file Comment.php.

244 {
245 $this->visible = $value;
246
247 return $this;
248 }

◆ setWidth()

PhpOffice\PhpSpreadsheet\Comment::setWidth (   $width)

Set comment width (CSS style, i.e.

XXpx or YYpt).

Parameters
string$width
Returns
$this

Definition at line 147 of file Comment.php.

148 {
149 $this->width = $width;
150
151 return $this;
152 }

References PhpOffice\PhpSpreadsheet\Comment\$width.

Field Documentation

◆ $alignment

PhpOffice\PhpSpreadsheet\Comment::$alignment
private

◆ $author

PhpOffice\PhpSpreadsheet\Comment::$author
private

◆ $fillColor

PhpOffice\PhpSpreadsheet\Comment::$fillColor
private

Definition at line 63 of file Comment.php.

Referenced by PhpOffice\PhpSpreadsheet\Comment\getFillColor().

◆ $height

PhpOffice\PhpSpreadsheet\Comment::$height = '55.5pt'
private

Definition at line 56 of file Comment.php.

Referenced by PhpOffice\PhpSpreadsheet\Comment\getHeight().

◆ $marginLeft

PhpOffice\PhpSpreadsheet\Comment::$marginLeft = '59.25pt'
private

Definition at line 35 of file Comment.php.

Referenced by PhpOffice\PhpSpreadsheet\Comment\getMarginLeft().

◆ $marginTop

PhpOffice\PhpSpreadsheet\Comment::$marginTop = '1.5pt'
private

Definition at line 42 of file Comment.php.

Referenced by PhpOffice\PhpSpreadsheet\Comment\getMarginTop().

◆ $text

PhpOffice\PhpSpreadsheet\Comment::$text
private

Definition at line 21 of file Comment.php.

Referenced by PhpOffice\PhpSpreadsheet\Comment\getText().

◆ $visible

PhpOffice\PhpSpreadsheet\Comment::$visible = false
private

Definition at line 49 of file Comment.php.

Referenced by PhpOffice\PhpSpreadsheet\Comment\getVisible().

◆ $width

PhpOffice\PhpSpreadsheet\Comment::$width = '96pt'
private

The documentation for this class was generated from the following file: