ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
TextElement.php
Go to the documentation of this file.
1<?php
2
4
5class TextElement implements ITextElement
6{
12 private $text;
13
19 public function __construct($pText = '')
20 {
21 // Initialise variables
22 $this->text = $pText;
23 }
24
30 public function getText()
31 {
32 return $this->text;
33 }
34
42 public function setText($text)
43 {
44 $this->text = $text;
45
46 return $this;
47 }
48
54 public function getFont()
55 {
56 return null;
57 }
58
64 public function getHashCode()
65 {
66 return md5(
67 $this->text .
68 __CLASS__
69 );
70 }
71
75 public function __clone()
76 {
77 $vars = get_object_vars($this);
78 foreach ($vars as $key => $value) {
79 if (is_object($value)) {
80 $this->$key = clone $value;
81 } else {
82 $this->$key = $value;
83 }
84 }
85 }
86}
An exception for terminatinating execution or to throw for unit testing.
__clone()
Implement PHP __clone to create a deep clone, not just a shallow copy.
Definition: TextElement.php:75
__construct($pText='')
Create a new TextElement instance.
Definition: TextElement.php:19
$key
Definition: croninfo.php:18