Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
<?php
2
 
3
declare(strict_types=1);
4
 
5
namespace OpenSpout\Writer\Common\Entity;
6
 
7
/**
8
 * Entity describing a workbook.
9
 */
10
final class Workbook
11
{
12
    /** @var Worksheet[] List of the workbook's sheets */
13
    private array $worksheets = [];
14
 
15
    /** @var string Timestamp based unique ID identifying the workbook */
16
    private readonly string $internalId;
17
 
18
    /**
19
     * Workbook constructor.
20
     */
21
    public function __construct()
22
    {
23
        $this->internalId = uniqid();
24
    }
25
 
26
    /**
27
     * @return Worksheet[]
28
     */
29
    public function getWorksheets(): array
30
    {
31
        return $this->worksheets;
32
    }
33
 
34
    /**
35
     * @param Worksheet[] $worksheets
36
     */
37
    public function setWorksheets(array $worksheets): void
38
    {
39
        $this->worksheets = $worksheets;
40
    }
41
 
42
    public function getInternalId(): string
43
    {
44
        return $this->internalId;
45
    }
46
}