ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
PageMargins.php
Go to the documentation of this file.
1<?php
2
4
6{
12 private $left = 0.7;
13
19 private $right = 0.7;
20
26 private $top = 0.75;
27
33 private $bottom = 0.75;
34
40 private $header = 0.3;
41
47 private $footer = 0.3;
48
52 public function __construct()
53 {
54 }
55
61 public function getLeft()
62 {
63 return $this->left;
64 }
65
73 public function setLeft($pValue)
74 {
75 $this->left = $pValue;
76
77 return $this;
78 }
79
85 public function getRight()
86 {
87 return $this->right;
88 }
89
97 public function setRight($pValue)
98 {
99 $this->right = $pValue;
100
101 return $this;
102 }
103
109 public function getTop()
110 {
111 return $this->top;
112 }
113
121 public function setTop($pValue)
122 {
123 $this->top = $pValue;
124
125 return $this;
126 }
127
133 public function getBottom()
134 {
135 return $this->bottom;
136 }
137
145 public function setBottom($pValue)
146 {
147 $this->bottom = $pValue;
148
149 return $this;
150 }
151
157 public function getHeader()
158 {
159 return $this->header;
160 }
161
169 public function setHeader($pValue)
170 {
171 $this->header = $pValue;
172
173 return $this;
174 }
175
181 public function getFooter()
182 {
183 return $this->footer;
184 }
185
193 public function setFooter($pValue)
194 {
195 $this->footer = $pValue;
196
197 return $this;
198 }
199
203 public function __clone()
204 {
205 $vars = get_object_vars($this);
206 foreach ($vars as $key => $value) {
207 if (is_object($value)) {
208 $this->$key = clone $value;
209 } else {
210 $this->$key = $value;
211 }
212 }
213 }
214
215 public static function fromCentimeters(float $value): float
216 {
217 return $value / 2.54;
218 }
219
220 public static function toCentimeters(float $value): float
221 {
222 return $value * 2.54;
223 }
224
225 public static function fromMillimeters(float $value): float
226 {
227 return $value / 25.4;
228 }
229
230 public static function toMillimeters(float $value): float
231 {
232 return $value * 25.4;
233 }
234
235 public static function fromPoints(float $value): float
236 {
237 return $value / 72;
238 }
239
240 public static function toPoints(float $value): float
241 {
242 return $value * 72;
243 }
244}
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.
$key
Definition: croninfo.php:18
margin left
Definition: langcheck.php:164