1 | <?php |
||
12 | class Font implements Component |
||
13 | { |
||
14 | /** |
||
15 | * @var int |
||
16 | */ |
||
17 | private $id; |
||
18 | |||
19 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | private $italic; |
||
23 | |||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | private $underline; |
||
28 | |||
29 | /** |
||
30 | * @var string |
||
31 | */ |
||
32 | private $bold; |
||
33 | |||
34 | /** |
||
35 | * @var string |
||
36 | */ |
||
37 | private $strikethrough; |
||
38 | |||
39 | /** |
||
40 | * @var string |
||
41 | */ |
||
42 | private $name = 'Calibri'; |
||
43 | |||
44 | /** |
||
45 | * @var int |
||
46 | */ |
||
47 | private $size = 11; |
||
48 | |||
49 | /** |
||
50 | * @var string |
||
51 | */ |
||
52 | private $color = '000000'; |
||
53 | |||
54 | /** |
||
55 | * @param int $id |
||
56 | * @return Font |
||
57 | */ |
||
58 | 4 | public function setId($id) |
|
59 | { |
||
60 | 4 | $this->id = $id; |
|
61 | 4 | return $this; |
|
62 | } |
||
63 | |||
64 | /** |
||
65 | * @return int |
||
66 | */ |
||
67 | 4 | public function getId() |
|
68 | { |
||
69 | 4 | return $this->id; |
|
70 | } |
||
71 | |||
72 | /** |
||
73 | * @return Font |
||
74 | */ |
||
75 | 1 | public function setItalic() |
|
76 | { |
||
77 | 1 | $this->italic = '<i/>'; |
|
78 | 1 | return $this; |
|
79 | } |
||
80 | |||
81 | /** |
||
82 | * @return Font |
||
83 | */ |
||
84 | 1 | public function setUnderline() |
|
85 | { |
||
86 | 1 | $this->underline = '<u/>'; |
|
87 | 1 | return $this; |
|
88 | } |
||
89 | |||
90 | /** |
||
91 | * @return bool |
||
92 | */ |
||
93 | 2 | public function isBold() |
|
94 | { |
||
95 | 2 | return null !== $this->bold; |
|
96 | } |
||
97 | |||
98 | /** |
||
99 | * @return Font |
||
100 | */ |
||
101 | 2 | public function setBold() |
|
102 | { |
||
103 | 2 | $this->bold = '<b/>'; |
|
104 | 2 | return $this; |
|
105 | } |
||
106 | |||
107 | /** |
||
108 | * @return Font |
||
109 | */ |
||
110 | 1 | public function setStrikethrough() |
|
111 | { |
||
112 | 1 | $this->strikethrough = '<s/>'; |
|
113 | 1 | } |
|
114 | |||
115 | /** |
||
116 | * @return string |
||
117 | */ |
||
118 | 2 | public function getName() |
|
122 | |||
123 | /** |
||
124 | * @param string $name |
||
125 | * @return Font |
||
126 | */ |
||
127 | 1 | public function setName($name) |
|
128 | { |
||
129 | 1 | $this->name = $name; |
|
130 | 1 | return $this; |
|
131 | } |
||
132 | |||
133 | /** |
||
134 | * @return int |
||
135 | */ |
||
136 | 2 | public function getSize() |
|
140 | |||
141 | /** |
||
142 | * @param int $size |
||
143 | * @return Font |
||
144 | */ |
||
145 | 1 | public function setSize($size) |
|
146 | { |
||
147 | 1 | $this->size = $size; |
|
148 | 1 | return $this; |
|
149 | } |
||
150 | |||
151 | /** |
||
152 | * @param string $color |
||
153 | * @return Font |
||
154 | */ |
||
155 | 2 | public function setColor($color) |
|
156 | { |
||
157 | 2 | $this->color = strtoupper($color); |
|
158 | 2 | return $this; |
|
159 | } |
||
160 | |||
161 | /** |
||
162 | * @return string |
||
163 | */ |
||
164 | 5 | public function asXml() |
|
177 | } |
||
178 |