1 | <?php |
||
17 | class PdfRequest extends CaptureRequest |
||
18 | implements PdfRequestInterface |
||
19 | { |
||
20 | /** |
||
21 | * Paper width |
||
22 | * |
||
23 | * @var int |
||
24 | * @access protected |
||
25 | */ |
||
26 | protected $paperWidth; |
||
27 | |||
28 | /** |
||
29 | * Paper height |
||
30 | * |
||
31 | * @var int |
||
32 | * @access protected |
||
33 | */ |
||
34 | protected $paperHeight; |
||
35 | |||
36 | /** |
||
37 | * Format |
||
38 | * |
||
39 | * @var string |
||
40 | * @access protected |
||
41 | */ |
||
42 | protected $format; |
||
43 | |||
44 | /** |
||
45 | * Orientation |
||
46 | * |
||
47 | * @var string |
||
48 | * @access protected |
||
49 | */ |
||
50 | protected $orientation; |
||
51 | |||
52 | /** |
||
53 | * Margin |
||
54 | * |
||
55 | * @var string |
||
56 | * @access protected |
||
57 | */ |
||
58 | protected $margin; |
||
59 | |||
60 | /** |
||
61 | * Repeating header |
||
62 | * |
||
63 | * @var array |
||
64 | * @access protected |
||
65 | */ |
||
66 | protected $header; |
||
67 | |||
68 | /** |
||
69 | 28 | * Repeating footer |
|
70 | * |
||
71 | 28 | * @var array |
|
72 | * @access protected |
||
73 | 28 | */ |
|
74 | 28 | protected $footer; |
|
75 | 28 | ||
76 | 28 | /** |
|
77 | 28 | * Internal constructor |
|
78 | * |
||
79 | 28 | * @access public |
|
80 | * @param string $url (default: null) |
||
81 | * @param string $method (default: RequestInterface::METHOD_GET) |
||
82 | * @param int $timeout (default: 5000) |
||
83 | * @return \JonnyW\PhantomJs\Http\CaptureRequest |
||
|
|||
84 | */ |
||
85 | public function __construct($url = null, $method = RequestInterface::METHOD_GET, $timeout = 5000) |
||
98 | |||
99 | /** |
||
100 | * Get request type |
||
101 | * |
||
102 | * @access public |
||
103 | * @return string |
||
104 | */ |
||
105 | public function getType() |
||
113 | |||
114 | 5 | /** |
|
115 | * Set paper width. |
||
116 | 5 | * |
|
117 | * @access public |
||
118 | * @param string $width |
||
119 | * @return void |
||
120 | */ |
||
121 | public function setPaperWidth($width) |
||
125 | |||
126 | /** |
||
127 | * Get paper width. |
||
128 | * |
||
129 | * @access public |
||
130 | * @return string |
||
131 | */ |
||
132 | public function getPaperWidth() |
||
136 | |||
137 | 5 | /** |
|
138 | * Set paper height. |
||
139 | 5 | * |
|
140 | * @access public |
||
141 | * @param string $height |
||
142 | * @return void |
||
143 | */ |
||
144 | public function setPaperHeight($height) |
||
148 | |||
149 | /** |
||
150 | 3 | * Get paper height. |
|
151 | * |
||
152 | 3 | * @access public |
|
153 | 3 | * @return string |
|
154 | 3 | */ |
|
155 | public function getPaperHeight() |
||
159 | |||
160 | /** |
||
161 | * Set paper size. |
||
162 | * |
||
163 | 2 | * @access public |
|
164 | * @param string $width |
||
165 | 2 | * @param string $height |
|
166 | 2 | * @return void |
|
167 | */ |
||
168 | public function setPaperSize($width, $height) |
||
173 | |||
174 | 4 | /** |
|
175 | * Set format. |
||
176 | 4 | * |
|
177 | * @access public |
||
178 | * @param string $format |
||
179 | * @return void |
||
180 | */ |
||
181 | public function setFormat($format) |
||
185 | |||
186 | 1 | /** |
|
187 | * Get format. |
||
188 | 1 | * |
|
189 | 1 | * @access public |
|
190 | * @return string |
||
191 | */ |
||
192 | public function getFormat() |
||
196 | |||
197 | 4 | /** |
|
198 | * Set orientation. |
||
199 | 4 | * |
|
200 | * @access public |
||
201 | * @param string $orientation |
||
202 | * @return void |
||
203 | */ |
||
204 | public function setOrientation($orientation) |
||
208 | |||
209 | 3 | /** |
|
210 | * Get orientation. |
||
211 | 3 | * |
|
212 | 3 | * @access public |
|
213 | * @return string |
||
214 | */ |
||
215 | public function getOrientation() |
||
219 | |||
220 | 4 | /** |
|
221 | * Set margin. |
||
222 | 4 | * |
|
223 | * @access public |
||
224 | * @param string $margin |
||
225 | * @return void |
||
226 | */ |
||
227 | public function setMargin($margin) |
||
231 | |||
232 | /** |
||
233 | * Get margin. |
||
234 | * |
||
235 | * @access public |
||
236 | * @return string |
||
237 | */ |
||
238 | public function getMargin() |
||
242 | |||
243 | /** |
||
244 | * Set repeating header. |
||
245 | * |
||
246 | * @access public |
||
247 | * @param string $content |
||
248 | * @param string $height (default: '1cm') |
||
249 | * @return void |
||
250 | */ |
||
251 | public function setRepeatingHeader($content, $height = '1cm') |
||
258 | |||
259 | /** |
||
260 | * Get repeating header. |
||
261 | * |
||
262 | * @access public |
||
263 | * @return array |
||
264 | */ |
||
265 | public function getRepeatingHeader() |
||
269 | |||
270 | /** |
||
271 | * Set repeating footer. |
||
272 | * |
||
273 | * @access public |
||
274 | * @param string $content |
||
275 | * @param string $height (default: '1cm') |
||
276 | * @return void |
||
277 | */ |
||
278 | public function setRepeatingFooter($content, $height = '1cm') |
||
285 | |||
286 | /** |
||
287 | * Get repeating footer. |
||
288 | * |
||
289 | * @access public |
||
290 | * @return array |
||
291 | */ |
||
292 | public function getRepeatingFooter() |
||
296 | } |
||
297 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.