1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Media\Entity; |
4
|
|
|
|
5
|
|
|
class Media |
6
|
|
|
{ |
7
|
|
|
|
8
|
|
|
/** |
9
|
|
|
* |
10
|
|
|
* @var resource |
11
|
|
|
*/ |
12
|
|
|
protected $fileContent; |
13
|
|
|
|
14
|
|
|
/** |
15
|
|
|
* |
16
|
|
|
* @var string |
17
|
|
|
* |
18
|
|
|
* @Column(type="string") |
19
|
|
|
*/ |
20
|
|
|
protected $context; |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* |
24
|
|
|
* @var string |
25
|
|
|
* |
26
|
|
|
* @Column(type="string", name="file_name") |
27
|
|
|
*/ |
28
|
|
|
protected $fileName; |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* |
32
|
|
|
* @var string |
33
|
|
|
* |
34
|
|
|
* @Column(type="string", name="file_type") |
35
|
|
|
*/ |
36
|
|
|
protected $fileType; |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* |
40
|
|
|
* @var int |
41
|
|
|
* |
42
|
|
|
* @Column(type="integer", name="file_size") |
43
|
|
|
*/ |
44
|
|
|
protected $fileSize; |
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* |
48
|
|
|
* @var array |
49
|
|
|
* |
50
|
|
|
* @Column(type="array", nullable=true) |
51
|
|
|
*/ |
52
|
|
|
protected $metadata; |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* |
56
|
|
|
* @return resource |
57
|
|
|
*/ |
58
|
|
|
public function getFileContent() |
59
|
|
|
{ |
60
|
|
|
return $this->fileContent; |
61
|
|
|
} |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* |
65
|
|
|
* @param resource $fileContent |
66
|
|
|
* |
67
|
|
|
* @return $this |
68
|
|
|
*/ |
69
|
|
|
public function setFileContent($fileContent) |
70
|
|
|
{ |
71
|
|
|
$this->fileContent = $fileContent; |
72
|
|
|
|
73
|
|
|
return $this; |
74
|
|
|
} |
75
|
|
|
|
76
|
|
|
/** |
77
|
|
|
* Set context |
78
|
|
|
* |
79
|
|
|
* @param string $context |
80
|
|
|
* |
81
|
|
|
* @return Media |
82
|
|
|
*/ |
83
|
|
|
public function setContext($context) |
84
|
|
|
{ |
85
|
|
|
$this->context = $context; |
86
|
|
|
|
87
|
|
|
return $this; |
88
|
|
|
} |
89
|
|
|
|
90
|
|
|
/** |
91
|
|
|
* Get context |
92
|
|
|
* |
93
|
|
|
* @return string |
94
|
|
|
*/ |
95
|
|
|
public function getContext() |
96
|
|
|
{ |
97
|
|
|
return $this->context; |
98
|
|
|
} |
99
|
|
|
|
100
|
|
|
/** |
101
|
|
|
* Set fileName |
102
|
|
|
* |
103
|
|
|
* @param string $fileName |
104
|
|
|
* |
105
|
|
|
* @return Media |
106
|
|
|
*/ |
107
|
|
|
public function setFileName($fileName) |
108
|
|
|
{ |
109
|
|
|
$this->fileName = $fileName; |
110
|
|
|
|
111
|
|
|
return $this; |
112
|
|
|
} |
113
|
|
|
|
114
|
|
|
/** |
115
|
|
|
* Get fileName |
116
|
|
|
* |
117
|
|
|
* @return string |
118
|
|
|
*/ |
119
|
|
|
public function getFileName() |
120
|
|
|
{ |
121
|
|
|
return $this->fileName; |
122
|
|
|
} |
123
|
|
|
|
124
|
|
|
/** |
125
|
|
|
* Set fileType |
126
|
|
|
* |
127
|
|
|
* @param string $fileType |
128
|
|
|
* |
129
|
|
|
* @return Media |
130
|
|
|
*/ |
131
|
|
|
public function setFileType($fileType) |
132
|
|
|
{ |
133
|
|
|
$this->fileType = $fileType; |
134
|
|
|
|
135
|
|
|
return $this; |
136
|
|
|
} |
137
|
|
|
|
138
|
|
|
/** |
139
|
|
|
* Get fileType |
140
|
|
|
* |
141
|
|
|
* @return string |
142
|
|
|
*/ |
143
|
|
|
public function getFileType() |
144
|
|
|
{ |
145
|
|
|
return $this->fileType; |
146
|
|
|
} |
147
|
|
|
|
148
|
|
|
/** |
149
|
|
|
* Set fileSize |
150
|
|
|
* |
151
|
|
|
* @param integer $fileSize |
152
|
|
|
* |
153
|
|
|
* @return Media |
154
|
|
|
*/ |
155
|
|
|
public function setFileSize($fileSize) |
156
|
|
|
{ |
157
|
|
|
$this->fileSize = $fileSize; |
158
|
|
|
|
159
|
|
|
return $this; |
160
|
|
|
} |
161
|
|
|
|
162
|
|
|
/** |
163
|
|
|
* Get fileSize |
164
|
|
|
* |
165
|
|
|
* @return integer |
166
|
|
|
*/ |
167
|
|
|
public function getFileSize() |
168
|
|
|
{ |
169
|
|
|
return $this->fileSize; |
170
|
|
|
} |
171
|
|
|
|
172
|
|
|
/** |
173
|
|
|
* Set metadata |
174
|
|
|
* |
175
|
|
|
* @param array $metadata |
176
|
|
|
* |
177
|
|
|
* @return Media |
178
|
|
|
*/ |
179
|
|
|
public function setMetadata($metadata) |
180
|
|
|
{ |
181
|
|
|
$this->metadata = $metadata; |
182
|
|
|
|
183
|
|
|
return $this; |
184
|
|
|
} |
185
|
|
|
|
186
|
|
|
/** |
187
|
|
|
* Get metadata |
188
|
|
|
* |
189
|
|
|
* @return array |
190
|
|
|
*/ |
191
|
|
|
public function getMetadata() |
192
|
|
|
{ |
193
|
|
|
return $this->metadata; |
194
|
|
|
} |
195
|
|
|
|
196
|
|
|
} |
197
|
|
|
|