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|array |
||
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 | * Repeating footer |
||
70 | * |
||
71 | * @var array |
||
72 | * @access protected |
||
73 | */ |
||
74 | protected $footer; |
||
75 | |||
76 | /** |
||
77 | * Internal constructor |
||
78 | * |
||
79 | * @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 | 29 | 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 | 8 | public function getType() |
|
113 | |||
114 | /** |
||
115 | * Set paper width. |
||
116 | * |
||
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 | 7 | public function getPaperWidth() |
|
136 | |||
137 | /** |
||
138 | * Set paper height. |
||
139 | * |
||
140 | * @access public |
||
141 | * @param string $height |
||
142 | * @return void |
||
143 | */ |
||
144 | public function setPaperHeight($height) |
||
148 | |||
149 | /** |
||
150 | * Get paper height. |
||
151 | * |
||
152 | * @access public |
||
153 | * @return string |
||
154 | */ |
||
155 | 7 | public function getPaperHeight() |
|
159 | |||
160 | /** |
||
161 | * Set paper size. |
||
162 | * |
||
163 | * @access public |
||
164 | * @param string $width |
||
165 | * @param string $height |
||
166 | * @return void |
||
167 | */ |
||
168 | 3 | public function setPaperSize($width, $height) |
|
173 | |||
174 | /** |
||
175 | * Set format. |
||
176 | * |
||
177 | * @access public |
||
178 | * @param string $format |
||
179 | * @return void |
||
180 | */ |
||
181 | 4 | public function setFormat($format) |
|
185 | |||
186 | /** |
||
187 | * Get format. |
||
188 | * |
||
189 | * @access public |
||
190 | * @return string |
||
191 | */ |
||
192 | 6 | public function getFormat() |
|
196 | |||
197 | /** |
||
198 | * Set orientation. |
||
199 | * |
||
200 | * @access public |
||
201 | * @param string $orientation |
||
202 | * @return void |
||
203 | */ |
||
204 | 3 | public function setOrientation($orientation) |
|
208 | |||
209 | /** |
||
210 | * Get orientation. |
||
211 | * |
||
212 | * @access public |
||
213 | * @return string |
||
214 | */ |
||
215 | 6 | public function getOrientation() |
|
219 | |||
220 | /** |
||
221 | * Set margin. |
||
222 | * |
||
223 | * @access public |
||
224 | * @param string|array $margin |
||
225 | * @return void |
||
226 | */ |
||
227 | 5 | public function setMargin($margin) |
|
231 | |||
232 | /** |
||
233 | * Get margin. |
||
234 | * |
||
235 | * @access public |
||
236 | * @return string|array |
||
237 | */ |
||
238 | 6 | 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 | 2 | public function setRepeatingHeader($content, $height = '1cm') |
|
258 | |||
259 | /** |
||
260 | * Get repeating header. |
||
261 | * |
||
262 | * @access public |
||
263 | * @return array |
||
264 | */ |
||
265 | 6 | 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 | 2 | public function setRepeatingFooter($content, $height = '1cm') |
|
285 | |||
286 | /** |
||
287 | * Get repeating footer. |
||
288 | * |
||
289 | * @access public |
||
290 | * @return array |
||
291 | */ |
||
292 | 6 | 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.