1: <?php
2: 3: 4: 5: 6: 7:
8:
9: namespace GLFramework\DaMa\Manipulators;
10:
11:
12: use GLFramework\Filesystem;
13: use TijsVerkoyen\CssToInlineStyles\Exception;
14:
15: class XLSXManipulator extends ManipulatorCore
16: {
17:
18: 19: 20:
21: var $reader;
22: public function open($file, $config = array())
23: {
24: $fs = new Filesystem();
25: $config['TempDir'] = $fs->getAbsolutePath();
26: $this->reader = new \SpreadsheetReader_XLSX($file, $config);
27: }
28:
29: public function next()
30: {
31:
32: if($this->reader->valid())
33: return array_map(array($this, 'map'), $this->reader->next());
34: return false;
35: }
36:
37: public function setSheet($index)
38: {
39: $this->reader->ChangeSheet($index);
40: parent::setSheet($index);
41: }
42:
43: public function map($item)
44: {
45: return $item;
46: }
47:
48: }