xref: /plugin/dw2pdf/src/PageCollector.php (revision 4c5691130dbf9035b960f10f5b3cb4b319a026d8)
1<?php
2
3namespace dokuwiki\plugin\dw2pdf\src;
4
5class PageCollector extends AbstractCollector
6{
7    /**
8     * @inheritdoc
9     * @throws ExportException When no page is given or the requested page does not exist
10     */
11    protected function collect(): array
12    {
13        $exportID = $this->getConfig()->getExportId();
14        if ($exportID === '') {
15            throw new ExportException('empty');
16        }
17
18        // no export for non existing page
19        if (!page_exists($exportID, $this->rev)) {
20            throw new ExportException('notexist');
21        }
22
23        return [$exportID];
24    }
25}
26