aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/mikespub/php-epub-meta/src/Contents/Nav.php
blob: e8eb980a632327c9a62cb9ce0a0848ae2c4875b2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php

namespace SebLucas\EPubMeta\Contents;

/**
 * EPUB NAV structure for EPUB 3
 *
 * @author Simon Schrape <simon@epubli.com>
 */
class Nav
{
    /** @var string from main document */
    protected $docTitle;
    /** @var string from main document */
    protected $docAuthor;
    /** @var NavPointList */
    protected $navMap;

    /**
     * Summary of __construct
     * @param string $title
     * @param string $author
     */
    public function __construct($title, $author)
    {
        $this->docTitle = $title;
        $this->docAuthor = $author;
        $this->navMap = new NavPointList();
    }

    /**
     * @return string
     */
    public function getDocTitle()
    {
        return $this->docTitle;
    }

    /**
     * @return string
     */
    public function getDocAuthor()
    {
        return $this->docAuthor;
    }

    /**
     * @return NavPointList
     */
    public function getNavMap()
    {
        return $this->navMap;
    }

    /**
     * @param string $file
     * @return array|NavPoint[]
     */
    public function findNavPointsForFile($file)
    {
        return $this->getNavMap()->findNavPointsForFile($file);
    }
}