Expose a Sheet object on Reader::XLSX::nextSheet()

Added Sheet class for the XLSX reader that exposes basic sheet info, such as name or ID.
When retrieving the sheet data XML, added extra XML parsing to retrieve sheet data.
Added test
This commit is contained in:
Adrien Loison committed 2015-04-29 00:27:45 -07:00
1 parent e58284d27b
commit e9ec4e745c
7 files changed
+279 -33

No files matched your search

+57
View File
@@ -0,0 +1,57 @@
<?php
namespace Box\Spout\Reader;
/**
* Class Sheet
* Represents a worksheet within a XLSX file
*
* @package Box\Spout\Reader
*/
class Sheet
{
/** @var int ID of the sheet */
protected $id;
/** @var int Number of the sheet, based on order of creation (zero-based) */
protected $number;
/** @var string Name of the sheet */
protected $name;
/**
* @param int $sheetId ID of the sheet
* @param int $sheetNumber Number of the sheet, based on order of creation (zero-based)
* @param string $sheetName Name of the sheet
*/
function __construct($sheetId, $sheetNumber, $sheetName)
{
$this->id = $sheetId;
$this->number = $sheetNumber;
$this->name = $sheetName;
}
/**
* @return int ID of the sheet
*/
public function getId()
{
return $this->id;
}
/**
* @return int Number of the sheet, based on order of creation (zero-based)
*/
public function getNumber()
{
return $this->number;
}
/**
* @return string Name of the sheet
*/
public function getName()
{
return $this->name;
}
}