1<?php
2
3namespace dokuwiki\TreeBuilder\Node;
4
5/**
6 * A node representing a namespace startpage
7 */
8class WikiStartpage extends WikiNamespace
9{
10    protected string $originalNamespace;
11
12    /**
13     * Constructor
14     *
15     * @param string $id The pageID of the startpage
16     * @param string|null $title The title as given in the link
17     * @param string $originalNamespace The original namespace
18     */
19    public function __construct(string $id, ?string $title, string $originalNamespace)
20    {
21        $this->originalNamespace = $originalNamespace;
22        parent::__construct($id, $title);
23    }
24
25    /**
26     * This will return the namespace this startpage is for
27     *
28     * This might differ from the namespace of the pageID, because a startpage may be outside
29     * the namespace.
30     *
31     * @inheritdoc
32     */
33    public function getNs(): string
34    {
35        return $this->originalNamespace;
36    }
37}
38