Completed
Push — master ( fb47da...fedb3d )
by WEBEWEB
01:20
created

Document::setPages()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
/*
4
 * This file is part of the core-library package.
5
 *
6
 * (c) 2020 WEBEWEB
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace WBW\Library\Core\ThirdParty\OcrLad\Model;
13
14
use WBW\Library\Core\Model\Attribute\StringFilenameTrait;
15
16
/**
17
 * Document.
18
 *
19
 * @author webeweb <https://github.com/webeweb>
20
 * @package WBW\Library\Core\ThirdParty\OcrLad\Model
21
 */
22
class Document {
23
24
    use StringFilenameTrait;
25
26
    /**
27
     * Pages.
28
     *
29
     * @var Page[]
30
     */
31
    private $pages;
32
33
    /**
34
     * Words.
35
     *
36
     * @var Word[]
37
     */
38
    private $words;
39
40
    /**
41
     * Constructor.
42
     */
43
    public function __construct() {
44
        $this->setPages([]);
45
        $this->setWords([]);
46
    }
47
48
    /**
49
     * Add a page.
50
     *
51
     * @param Page $page The page.
52
     * @return Document Returns this document.
53
     */
54
    public function addPage(Page $page) {
55
        $this->pages[] = $page;
56
        return $this;
57
    }
58
59
    /**
60
     * Add a word.
61
     *
62
     * @param Word $word The word.
63
     * @return Document Returns this document.
64
     */
65
    public function addWord(Word $word) {
66
        $this->words[] = $word;
67
        return $this;
68
    }
69
70
    /**
71
     * Get the pages.
72
     *
73
     * @return Page[] Returns the pages.
74
     */
75
    public function getPages() {
76
        return $this->pages;
77
    }
78
79
    /**
80
     * Get the words.
81
     *
82
     * @return Word[] Returns the words.
83
     */
84
    public function getWords() {
85
        return $this->words;
86
    }
87
88
    /**
89
     * Set the pages.
90
     *
91
     * @param Page[] $pages The pages.
92
     * @return Document Returns this document.
93
     */
94
    protected function setPages(array $pages) {
95
        $this->pages = $pages;
96
        return $this;
97
    }
98
99
    /**
100
     * Set the words.
101
     *
102
     * @param Word[] $words The words.
103
     * @return Document Returns this document.
104
     */
105
    protected function setWords(array $words) {
106
        $this->words = $words;
107
        return $this;
108
    }
109
}