1 | <?php |
||
22 | class Excel |
||
23 | { |
||
24 | /* @var $excelFactoryNameSpace Namespace PHPExcel Factory IO */ |
||
25 | private $excelFactoryNameSpace; |
||
26 | |||
27 | /* @var $excelObject PHPExcel */ |
||
28 | private $excelObject; |
||
29 | |||
30 | |||
31 | private $numberOfSheets = 0; |
||
32 | protected $currentSheetTitle; |
||
33 | |||
34 | private $sheet; |
||
35 | |||
36 | private $reportPath; |
||
37 | |||
38 | private $outputFormat; |
||
39 | |||
40 | /** |
||
41 | * |
||
42 | * @param string $defaultReportPath |
||
43 | * @param string $excelFactoryNameSpace |
||
44 | * @param string $outputFormat |
||
45 | */ |
||
46 | public function __construct( |
||
57 | |||
58 | /** |
||
59 | * Initiate a PHP Excel object |
||
60 | * |
||
61 | * @return $this |
||
62 | */ |
||
63 | public function createExcelObject() |
||
69 | |||
70 | /** |
||
71 | * Create a new sheet within the excel object and ready the service for it. |
||
72 | * This in essence resets most things so make sure you have finished working |
||
73 | * on your sheet before creating another. |
||
74 | * |
||
75 | * @param string $title The name of the sheet |
||
76 | * |
||
77 | * @return [type] [description] |
||
|
|||
78 | */ |
||
79 | public function newSheet($title = '') |
||
102 | |||
103 | /** |
||
104 | * Use the PHPExcel factory writer and output the current excel object in to |
||
105 | * a file |
||
106 | * |
||
107 | * @param string $fileName |
||
108 | * @param string $path |
||
109 | * @param string $outputFormat |
||
110 | * @return File |
||
111 | * @throws \Exception When trying to use on the fly unsupported output format |
||
112 | */ |
||
113 | public function save($fileName, $path = '', $outputFormat = '') |
||
143 | |||
144 | /** |
||
145 | * Set a file path where the saved report will be output to. |
||
146 | * |
||
147 | * @param string $path |
||
148 | * @param boolean $createPath |
||
149 | * @throws \Exception |
||
150 | */ |
||
151 | public function setReportPath($path, $createPath = true) |
||
164 | |||
165 | /** |
||
166 | * Set the "excel type" that will PHPExcel will output |
||
167 | * Excel2007 / Excel5 / Excel2003XML / SYLK / OOCalc / CSV / HTML. |
||
168 | * |
||
169 | * @param string $format [description] |
||
170 | */ |
||
171 | public function setOutputFormat($format) |
||
182 | |||
183 | /** |
||
184 | * @return string |
||
185 | */ |
||
186 | public function getCurrentSheetTitle() |
||
190 | |||
191 | /** |
||
192 | * @return integer |
||
193 | */ |
||
194 | public function getNumberOfSheets() |
||
198 | |||
199 | /** |
||
200 | * @return \PHPExcel |
||
201 | */ |
||
202 | public function getExcelObject() |
||
206 | |||
207 | /** |
||
208 | * @return string |
||
209 | */ |
||
210 | public function getReportPath() |
||
214 | |||
215 | /** |
||
216 | * @return string |
||
217 | */ |
||
218 | public function getOutputFormat() |
||
222 | |||
223 | /** |
||
224 | * Take a given format and check whether it is compatible with what PHPExcel |
||
225 | * is able to export |
||
226 | * |
||
227 | * @param string $format |
||
228 | * @return boolean|null |
||
229 | */ |
||
230 | public function checkOutputFormat($format) |
||
246 | |||
247 | /** |
||
248 | * @param string $title |
||
249 | */ |
||
250 | protected function setCurrentSheetTitle($title) |
||
254 | } |
||
255 |
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.