Esempio n. 1
0
 /**
  * file_to_soap : return the soap FRSFile structure giving a PHP FRSFile Object.
  * @access private
  * 
  * WARNING : We check the permissions here : only the readable files are returned.
  *
  * @param Object{FRSFile} $file the file to convert.
  * @return array the SOAPFRSFile corresponding to the FRSFile Object
  */
 function file_to_soap(FRSFile $file)
 {
     $return = null;
     if ($file->isError()) {
         //skip if error
     } else {
         // for the moment, no permissions on files
         $return = array('file_id' => $file->getFileID(), 'release_id' => $file->getReleaseID(), 'file_name' => $file->getFileName(), 'file_size' => $file->getFileSize(), 'type_id' => $file->getTypeID(), 'processor_id' => $file->getProcessorID(), 'release_time' => $file->getReleaseTime(), 'post_date' => $file->getPostDate(), 'computed_md5' => $file->getComputedMd5(), 'reference_md5' => $file->getReferenceMd5(), 'user_id' => $file->getUserID(), 'comment' => $file->getComment());
     }
     return $return;
 }
 /**
  * Mark the files that site admin wants to restore
  *
  * @param FRSFile $file
  *
  * @return Boolean
  */
 public function markFileToBeRestored($file)
 {
     $release = $this->_getFRSReleaseFactory()->getFRSReleaseFromDb($file->getReleaseID(), null, null, true);
     if (!$release->isDeleted()) {
         $dao = $this->_getFRSFileDao();
         return $dao->markFileToBeRestored($file->getFileID());
     }
     return false;
 }