Bookmark::setLevel()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
1
<?php
2
/**
3
 * PDFtk wrapper
4
 *
5
 * @copyright 2014-2019 Institute of Legal Medicine, Medical University of Innsbruck
6
 * @author Martin Pircher <[email protected]>
7
 * @author Andreas Erhard <[email protected]>
8
 * @license LGPL-3.0-only
9
 * @link http://www.gerichtsmedizin.at/
10
 *
11
 * @package pdftk
12
 */
13
14
namespace Gmi\Toolkit\Pdftk;
15
16
/**
17
 * Represents a single PDF bookmark.
18
 */
19
class Bookmark
20
{
21
    /**
22
     * Bookmark title, as displayed in the PDF viewer's bookmark list.
23
     *
24
     * @var string
25
     */
26
    private $title;
27
28
    /**
29
     * Page where the bookmark is written.
30
     *
31
     * @var int
32
     */
33
    private $pageNumber;
34
35
    /**
36
     * Bookmark level.
37
     *
38
     * @var int
39
     */
40
    private $level = 1;
41
42
    /**
43
     * Sets the bookmark title.
44
     *
45
     * @param string $title
46
     *
47
     * @return self
48
     */
49 11
    public function setTitle($title)
50
    {
51 11
        $this->title = $title;
52
53 11
        return $this;
54
    }
55
56
    /**
57
     * Returns the bookmark title.
58
     *
59
     * @return string
60
     */
61 4
    public function getTitle()
62
    {
63 4
        return $this->title;
64
    }
65
66
    /**
67
     * Sets the bookmark page.
68
     *
69
     * @param int $pageNumber
70
     *
71
     * @return self
72
     */
73 11
    public function setPageNumber($pageNumber)
74
    {
75 11
        $this->pageNumber = $pageNumber;
76
77 11
        return $this;
78
    }
79
80
    /**
81
     * Returns the bookmark page.
82
     *
83
     * @return int
84
     */
85 11
    public function getPageNumber()
86
    {
87 11
        return $this->pageNumber;
88
    }
89
90
    /**
91
     * Sets the bookmark level.
92
     *
93
     * @param int $level
94
     *
95
     * @return self
96
     */
97 9
    public function setLevel($level)
98
    {
99 9
        $this->level = $level;
100
101 9
        return $this;
102
    }
103
104
    /**
105
     * Returns the bookmark level.
106
     *
107
     * @return int
108
     */
109 4
    public function getLevel()
110
    {
111 4
        return $this->level;
112
    }
113
}
114