| 1 |
<?php |
| 2 |
|
| 3 |
namespace FluentCart\OpenSpout\Reader\CSV; |
| 4 |
|
| 5 |
use FluentCart\OpenSpout\Reader\SheetInterface; |
| 6 |
class Sheet implements SheetInterface |
| 7 |
{ |
| 8 |
/** @var \OpenSpout\Reader\CSV\RowIterator To iterate over the CSV's rows */ |
| 9 |
protected $rowIterator; |
| 10 |
/** |
| 11 |
* @param RowIterator $rowIterator Corresponding row iterator |
| 12 |
*/ |
| 13 |
public function __construct(RowIterator $rowIterator) |
| 14 |
{ |
| 15 |
$this->rowIterator = $rowIterator; |
| 16 |
} |
| 17 |
/** |
| 18 |
* @return \OpenSpout\Reader\CSV\RowIterator |
| 19 |
*/ |
| 20 |
public function getRowIterator() |
| 21 |
{ |
| 22 |
return $this->rowIterator; |
| 23 |
} |
| 24 |
/** |
| 25 |
* @return int Index of the sheet |
| 26 |
*/ |
| 27 |
public function getIndex() |
| 28 |
{ |
| 29 |
return 0; |
| 30 |
} |
| 31 |
/** |
| 32 |
* @return string Name of the sheet - empty string since CSV does not support that |
| 33 |
*/ |
| 34 |
public function getName() |
| 35 |
{ |
| 36 |
return ''; |
| 37 |
} |
| 38 |
/** |
| 39 |
* @return bool Always TRUE as there is only one sheet |
| 40 |
*/ |
| 41 |
public function isActive() |
| 42 |
{ |
| 43 |
return \true; |
| 44 |
} |
| 45 |
/** |
| 46 |
* @return bool Always TRUE as the only sheet is always visible |
| 47 |
*/ |
| 48 |
public function isVisible() |
| 49 |
{ |
| 50 |
return \true; |
| 51 |
} |
| 52 |
} |
| 53 |
|