00001 <?php
00002
00016 define('LIBRARY_FILE_TYPE_CONTRACT', 0x00001);
00017 define('LIBRARY_FILE_TYPE_MARKETING', 0x00002);
00018 define('LIBRARY_FILE_TYPE_PERMISSION', 0x00003);
00019 define('LIBRARY_FILE_TYPE_REPORT', 0x00004);
00020 define('LIBRARY_FILE_TYPE_OTHER', 0x00005);
00021
00022 class LibraryFile extends DataObject {
00026 function LibraryFile() {
00027 parent::DataObject();
00028 }
00029
00034 function getFilePath() {
00035 $pressId = $this->getPressId();
00036
00037 return Config::getVar('files', 'public_files_dir') . '/presses/' . $pressId . '/library/' . $this->getFileName();
00038 }
00039
00040
00041
00042
00047 function getPressId() {
00048 return $this->getData('pressId');
00049 }
00050
00055 function setPressId($pressId) {
00056 return $this->setData('pressId', $pressId);
00057 }
00058
00063 function getMonographId() {
00064 return $this->getData('monographId');
00065 }
00066
00071 function setMonographId($monographId) {
00072 return $this->setData('monographId', $monographId);
00073 }
00074
00079 function getFileName() {
00080 return $this->getData('fileName');
00081 }
00082
00087 function setFileName($fileName) {
00088 return $this->setData('fileName', $fileName);
00089 }
00090
00095 function getOriginalFileName() {
00096 return $this->getData('originalFileName');
00097 }
00098
00103 function setOriginalFileName($originalFileName) {
00104 return $this->setData('originalFileName', $originalFileName);
00105 }
00106
00112 function setName($name, $locale) {
00113 $this->setData('name', $name, $locale);
00114 }
00115
00121 function getName($locale) {
00122 return $this->getData('name', $locale);
00123 }
00124
00129 function getLocalizedName() {
00130 return $this->getLocalizedData('name');
00131 }
00132
00137 function getFileType() {
00138 return $this->getData('fileType');
00139 }
00140
00145 function setFileType($fileType) {
00146 return $this->setData('fileType', $fileType);
00147 }
00148
00153 function getType() {
00154 return $this->getData('type');
00155 }
00156
00161 function setType($type) {
00162 return $this->setData('type', $type);
00163 }
00164
00169 function getDateUploaded() {
00170 return $this->getData('dateUploaded');
00171 }
00172
00177 function setDateUploaded($dateUploaded) {
00178 return $this->SetData('dateUploaded', $dateUploaded);
00179 }
00180
00185 function getDateModified() {
00186 return $this->getData('dateModified');
00187 }
00188
00193 function setDateModified($dateModified) {
00194 return $this->SetData('dateModified', $dateModified);
00195 }
00196
00201 function getFileSize() {
00202 return $this->getData('fileSize');
00203 }
00204
00205
00210 function setFileSize($fileSize) {
00211 return $this->SetData('fileSize', $fileSize);
00212 }
00213
00218 function getNiceFileSize() {
00219 $fileManager = new FileManager();
00220 return $fileManager->getNiceFileSize($this->getData('fileSize'));
00221 }
00222
00227 function getDocumentType() {
00228 import('lib.pkp.classes.file.FileManager');
00229 $fileManager = new FileManager();
00230 return $fileManager->getDocumentType($this->getFileType());
00231 }
00232 }
00233
00234 ?>