Total Complexity | 9 |
Total Lines | 48 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
8 | class CsvContiguousFilter implements IReadFilter |
||
9 | { |
||
10 | private $startRow = 0; |
||
11 | |||
12 | private $endRow = 0; |
||
13 | |||
14 | private $filterType = 0; |
||
15 | |||
16 | /** |
||
17 | * Set the list of rows that we want to read. |
||
18 | * |
||
19 | * @param mixed $startRow |
||
20 | * @param mixed $chunkSize |
||
21 | */ |
||
22 | public function setRows($startRow, $chunkSize) |
||
23 | { |
||
24 | $this->startRow = $startRow; |
||
25 | $this->endRow = $startRow + $chunkSize; |
||
26 | } |
||
27 | |||
28 | public function setFilterType($type) |
||
31 | } |
||
32 | |||
33 | public function filter1($row) |
||
34 | { |
||
35 | // Include rows 1-10, followed by 100-110, etc. |
||
36 | return $row % 100 <= 10; |
||
37 | } |
||
38 | |||
39 | public function filter0($row) |
||
40 | { |
||
41 | // Only read the heading row, and the rows that are configured in $this->_startRow and $this->_endRow |
||
42 | if (($row == 1) || ($row >= $this->startRow && $row < $this->endRow)) { |
||
43 | return true; |
||
44 | } |
||
45 | |||
46 | return false; |
||
47 | } |
||
48 | |||
49 | public function readCell($column, $row, $worksheetName = '') |
||
56 | } |
||
57 | } |
||
58 |