Ejemplo n.º 1
0
 /**
  * Speichert Datei und verknüpft sie mit dem Dokument.
  *
  * @param Opus_Model_AbstractDb $document
  */
 public function updateModel($document)
 {
     $files = $this->getFileInfo();
     foreach ($files as $file) {
         /* TODO: Uncaught exception 'Zend_File_Transfer_Exception' with message '"fileupload" not found by file transfer adapter
          * if (!$upload->isValid($file)) {
          *    $this->view->message = 'Upload failed: Not a valid file!';
          *    break;
          * }
          */
         $docfile = $document->addFile();
         $docfile->setLabel($this->getElementValue(self::ELEMENT_LABEL));
         $docfile->setComment($this->getElementValue(self::ELEMENT_COMMENT));
         $docfile->setLanguage($this->getElementValue(self::ELEMENT_LANGUAGE));
         $docfile->setSortOrder($this->getElementValue(self::ELEMENT_SORT_ORDER));
         $docfile->setPathName(urldecode($file['name']));
         $docfile->setMimeType($file['type']);
         $docfile->setTempFile($file['tmp_name']);
     }
 }