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