Passed
Push — master ( 19f06a...8d1e35 )
by Ralf
24:17
created

DocumentForm::setFedoraPid()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
namespace EWW\Dpf\Domain\Model;
3
4
/*
5
 * This file is part of the TYPO3 CMS project.
6
 *
7
 * It is free software; you can redistribute it and/or modify it under
8
 * the terms of the GNU General Public License, either version 2
9
 * of the License, or any later version.
10
 *
11
 * For the full copyright and license information, please read the
12
 * LICENSE.txt file that was distributed with this source code.
13
 *
14
 * The TYPO3 project - inspiring people to share!
15
 */
16
17
class DocumentForm extends AbstractFormElement
18
{
19
20
    /**
21
     *
22
     * @var integer
23
     */
24
    protected $documentUid;
25
26
    /**
27
     *
28
     * @var boolean
29
     */
30
    protected $primaryFileMandatory;
31
32
    /**
33
     *
34
     * @var string
35
     */
36
    protected $fedoraPid;
37
38
    /**
39
     *
40
     * @var \EWW\Dpf\Domain\Model\File
41
     */
42
    protected $primaryFile;
43
44
    /**
45
     *
46
     * @var array
47
     */
48
    protected $secondaryFiles;
49
50
    /**
51
     *
52
     * @var array
53
     */
54
    protected $deletedFiles;
55
56
    /**
57
     *
58
     * @var array
59
     */
60
    protected $newFiles;
61
62
    /**
63
     *
64
     * @var string
65
     */
66
    protected $objectState;
67
68
    /**
69
     *
70
     * @var boolean
71
     */
72
    protected $valid = false;
73
74
    /**
75
     *
76
     * @var string
77
     */
78
    protected $processNumber;
79
80
    /**
81
     * @var bool
82
     */
83
    protected $temporary;
84
85
    /**
86
     * @var string
87
     */
88
    protected $comment = '';
89
90
    /**
91
     *
92
     * @return integer
93
     */
94
    public function getDocumentUid()
95
    {
96
        return $this->documentUid;
97
    }
98
99
    /**
100
     *
101
     * @param integer $documentUid
102
     */
103
    public function setDocumentUid($documentUid)
104
    {
105
        $this->documentUid = $documentUid;
106
    }
107
108
    /**
109
     *
110
     * @return boolean
111
     */
112
    public function getPrimaryFileMandatory()
113
    {
114
        return $this->primaryFileMandatory;
115
    }
116
117
    /**
118
     *
119
     * @param boolean $primaryFileMandatory
120
     */
121
    public function setPrimaryFileMandatory($primaryFileMandatory)
122
    {
123
        $this->primaryFileMandatory = boolval($primaryFileMandatory);
124
    }
125
126
    /**
127
     *
128
     * @return string
129
     */
130
    public function getFedoraPid()
131
    {
132
        return $this->fedoraPid;
133
    }
134
135
    /**
136
     *
137
     * @param string $fedoraPid
138
     */
139
    public function setFedoraPid($fedoraPid)
140
    {
141
        $this->fedoraPid = $fedoraPid;
142
    }
143
144
    /**
145
     *
146
     * @param type \EWW\Dpf\Domain\Model\File $primaryFile
147
     */
148
    public function setPrimaryFile($primaryFile)
149
    {
150
        $this->primaryFile = $primaryFile;
151
    }
152
153
    /**
154
     *
155
     * @return \EWW\Dpf\Domain\Model\File
156
     */
157
    public function getPrimaryFile()
158
    {
159
        return $this->primaryFile;
160
    }
161
162
    public function setSecondaryFiles($secondaryFiles)
163
    {
164
        $this->secondaryFiles = $secondaryFiles;
165
    }
166
167
    public function getSecondaryFiles()
168
    {
169
        return $this->secondaryFiles;
170
    }
171
172
    public function getDeletedFiles()
173
    {
174
        return $this->deletedFiles;
175
    }
176
177
    public function setDeletedFiles($deletedFiles)
178
    {
179
        $this->deletedFiles = $deletedFiles;
180
    }
181
182
    public function getNewFiles()
183
    {
184
        return $this->newFiles;
185
    }
186
187
    public function setNewFiles($newFiles)
188
    {
189
        $this->newFiles = $newFiles;
190
    }
191
192
    /**
193
     * @return bool
194
     */
195
    public function getValid()
196
    {
197
        return $this->valid;
198
    }
199
200
    /**
201
     * @param bool $valid
202
     */
203
    public function setValid($valid)
204
    {
205
        $this->valid = boolval($valid);
206
    }
207
208
    public function getNewFileNames()
209
    {
210
        $fileNames = array();
211
        foreach ($this->getNewFiles() as $file) {
212
            $fileNames[] = $file->getTitle();
213
        }
214
        return $fileNames;
215
    }
216
217
    /**
218
     * Sets the process number
219
     *
220
     * @return string
221
     */
222
    public function getProcessNumber()
223
    {
224
        return $this->processNumber;
225
    }
226
227
    /**
228
     * Gets the process number
229
     *
230
     * @param string $processNumber
231
     */
232
    public function setProcessNumber($processNumber)
233
    {
234
        $this->processNumber = $processNumber;
235
    }
236
237
    /**
238
     * Returns if a document is a temporary document.
239
     *
240
     * @return bool
241
     */
242
    public function isTemporary()
243
    {
244
        return $this->temporary;
245
    }
246
247
    /**
248
     * Sets if a document is a temporary document or not.
249
     * @param bool $temporary
250
     */
251
    public function setTemporary($temporary)
252
    {
253
        $this->temporary = boolval($temporary);
254
    }
255
256
    /**
257
     * @return string
258
     */
259
    public function getComment()
260
    {
261
        return $this->comment;
262
    }
263
264
    /**
265
     * @param string $comment
266
     */
267
    public function setComment($comment)
268
    {
269
        $this->comment = $comment;
270
    }
271
272
}
273