/
SubmissionFile.inc.php
248 lines (213 loc) · 4.68 KB
/
SubmissionFile.inc.php
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
<?php
/**
* @file classes/submission/SubmissionFile.inc.php
*
* Copyright (c) 2013-2019 Simon Fraser University
* Copyright (c) 2003-2019 John Willinsky
* Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
*
* @class SubmissionFile
* @ingroup submission
*
* @brief Submission file class.
*/
import('lib.pkp.classes.file.PKPFile');
class SubmissionFile extends PKPFile {
/**
* Constructor.
*/
function SubmissionFile() {
parent::PKPFile();
}
//
// Getters and Setters
//
/**
* Get ID of file.
* @return int
*/
function getFileId() {
// WARNING: Do not modernize getter/setters without considering
// ID clash with subclasses ArticleGalley and ArticleNote!
return $this->getData('fileId');
}
/**
* Set ID of file.
* @param $fileId int
*/
function setFileId($fileId) {
// WARNING: Do not modernize getter/setters without considering
// ID clash with subclasses ArticleGalley and ArticleNote!
return $this->setData('fileId', $fileId);
}
/**
* Get source file ID of this file.
* @return int
*/
function getSourceFileId() {
return $this->getData('sourceFileId');
}
/**
* Set source file ID of this file.
* @param $sourceFileId int
*/
function setSourceFileId($sourceFileId) {
return $this->setData('sourceFileId', $sourceFileId);
}
/**
* Get source revision of this file.
* @return int
*/
function getSourceRevision() {
return $this->getData('sourceRevision');
}
/**
* Set source revision of this file.
* @param $sourceRevision int
*/
function setSourceRevision($sourceRevision) {
return $this->setData('sourceRevision', $sourceRevision);
}
/**
* Get associated ID of file. (Used, e.g., for email log attachments.)
* @return int
*/
function getAssocId() {
return $this->getData('assocId');
}
/**
* Set associated ID of file. (Used, e.g., for email log attachments.)
* @param $assocId int
*/
function setAssocId($assocId) {
return $this->setData('assocId', $assocId);
}
/**
* Get revision number.
* @return int
*/
function getRevision() {
return $this->getData('revision');
}
/**
* Get the combined key of the file
* consisting of the file id and the revision.
* @return string
*/
function getFileIdAndRevision() {
$id = $this->getFileId();
$revision = $this->getRevision();
$idAndRevision = $id;
if ($revision) {
$idAndRevision .= '-'.$revision;
}
return $idAndRevision;
}
/**
* Set revision number.
* @param $revision int
*/
function setRevision($revision) {
return $this->setData('revision', $revision);
}
/**
* Get ID of submission.
* @return int
*/
function getSubmissionId() {
return $this->getData('submissionId');
}
/**
* Set ID of submission.
* @param $submissionId int
*/
function setSubmissionId($submissionId) {
return $this->setData('submissionId', $submissionId);
}
/**
* Get type of the file.
* @return int
*/
function getType() {
if (Config::getVar('debug', 'deprecation_warnings')) trigger_error('Deprecated function.');
return $this->getFileStage();
}
/**
* Set type of the file.
* @param $type int
*/
function setType($type) {
if (Config::getVar('debug', 'deprecation_warnings')) trigger_error('Deprecated function.');
return $this->setFileStage($type);
}
/**
* Get file stage of the file.
* @return int
*/
function getFileStage() {
return $this->getData('fileStage');
}
/**
* Set file stage of the file.
* @param $fileStage int
*/
function setFileStage($fileStage) {
return $this->setData('fileStage', $fileStage);
}
/**
* Get modified date of file.
* @return date
*/
function getDateModified() {
return $this->getData('dateModified');
}
/**
* Set modified date of file.
* @param $dateModified date
*/
function setDateModified($dateModified) {
return $this->SetData('dateModified', $dateModified);
}
/**
* Get round.
* @return int
*/
function getRound() {
return $this->getData('round');
}
/**
* Set round.
* @param $round int
*/
function setRound($round) {
return $this->SetData('round', $round);
}
/**
* Get viewable.
* @return boolean
*/
function getViewable() {
return $this->getData('viewable');
}
/**
* Set viewable.
* @param $viewable boolean
*/
function setViewable($viewable) {
return $this->SetData('viewable', $viewable);
}
//
// Public methods
//
/**
* Check if the file may be displayed inline.
* FIXME: Move to DAO to remove coupling of the domain
* object to its DAO.
* @return boolean
*/
function isInlineable() {
$submissionFileDao =& DAORegistry::getDAO('SubmissionFileDAO'); /* @var $submissionFileDao SubmissionFileDAO */
return $submissionFileDao->isInlineable($this);
}
}
?>