spout/src/Spout/Writer/Entity/Workbook.php
Adrien Loison bc17311f5f Refactor writers for better DI (#427)
This commit is a big refactor that improves the code organization.
It focuses on how dependencies are injected into the different classes. This is now done via some factories.

Also, the code is now built around entities (data model that only exposes getters and setters), managers (used to manage an entity) and helpers (used by the managers to perform some specific tasks).

The refactoring is not fully complete, as some dependencies are still hidden...
2017-05-29 22:18:40 +02:00

50 lines
878 B
PHP

<?php
namespace Box\Spout\Writer\Entity;
/**
* Class Workbook
* Entity describing a workbook
*
* @package Box\Spout\Writer\Entity
*/
class Workbook
{
/** @var Worksheet[] List of the workbook's sheets */
private $worksheets = [];
/** @var string Timestamp based unique ID identifying the workbook */
private $internalId;
/**
* Workbook constructor.
*/
public function __construct()
{
$this->internalId = uniqid();
}
/**
* @return Worksheet[]
*/
public function getWorksheets()
{
return $this->worksheets;
}
/**
* @param Worksheet[] $worksheets
*/
public function setWorksheets($worksheets)
{
$this->worksheets = $worksheets;
}
/**
* @return string
*/
public function getInternalId()
{
return $this->internalId;
}
}