1 | <?php |
||
14 | class Template |
||
15 | { |
||
16 | /** |
||
17 | * templates. |
||
18 | */ |
||
19 | const TEMPLATES = [ |
||
20 | 'xlsx' => 'Office Open XML Spreadsheet', |
||
21 | 'xls' => 'Microsoft Excel 97-2003', |
||
22 | 'xlt' => 'Microsoft Excel 97-2003 Template', |
||
23 | 'csv' => 'Text CSV', |
||
24 | 'ods' => 'ODF Spreadsheet', |
||
25 | 'ots' => 'ODF Spreadsheet Template', |
||
26 | 'docx' => 'Office Open XML Text', |
||
27 | 'doc' => 'Microsoft Word 97-2003', |
||
28 | 'dot' => 'Microsoft Word 97-2003 Template', |
||
29 | 'odt' => 'ODF Textdocument', |
||
30 | 'ott' => 'ODF Textdocument Template', |
||
31 | 'pptx' => 'Office Open XML Presentation', |
||
32 | 'ppt' => 'Microsoft Powerpoint 97-2003', |
||
33 | 'potm' => 'Microsoft Powerpoint 97-2003 Template', |
||
34 | 'odp' => 'ODF Presentation', |
||
35 | 'otp' => 'ODF Presentation Template', |
||
36 | ]; |
||
37 | |||
38 | /** |
||
39 | * Type. |
||
40 | * |
||
41 | * @var string |
||
42 | */ |
||
43 | protected $type; |
||
44 | |||
45 | /** |
||
46 | * Open template. |
||
47 | */ |
||
48 | public function __construct(string $type) |
||
56 | |||
57 | /** |
||
58 | * Get template size. |
||
59 | */ |
||
60 | public function getSize(): int |
||
64 | |||
65 | /** |
||
66 | * Open template stream. |
||
67 | * |
||
68 | * @return resource |
||
69 | */ |
||
70 | public function get() |
||
74 | |||
75 | /** |
||
76 | * Get path to template. |
||
77 | */ |
||
78 | protected function getTemplate(): string |
||
83 | } |
||
84 |