當前位置: 首頁>>代碼示例>>PHP>>正文


PHP AttachmentFile::delete方法代碼示例

本文整理匯總了PHP中AttachmentFile::delete方法的典型用法代碼示例。如果您正苦於以下問題:PHP AttachmentFile::delete方法的具體用法?PHP AttachmentFile::delete怎麽用?PHP AttachmentFile::delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在AttachmentFile的用法示例。


在下文中一共展示了AttachmentFile::delete方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: removeLicense

 public function removeLicense()
 {
     //delete all documents and associated expressions and SFX providers
     $document = new Document();
     foreach ($this->getDocuments() as $document) {
         //delete all expressions and expression notes
         $expression = new Expression();
         foreach ($document->getExpressions() as $expression) {
             $expressionNote = new ExpressionNote();
             foreach ($expression->getExpressionNotes() as $expressionNote) {
                 $expressionNote->delete();
             }
             $expression->removeQualifiers();
             $expression->delete();
         }
         $sfxProvider = new SFXProvider();
         foreach ($document->getSFXProviders() as $sfxProvider) {
             $sfxProvider->delete();
         }
         $signature = new Signature();
         foreach ($document->getSignatures() as $signature) {
             $signature->delete();
         }
         $document->delete();
     }
     //delete all attachments
     $attachment = new Attachment();
     foreach ($this->getAttachments() as $attachment) {
         $attachmentFile = new AttachmentFile();
         foreach ($attachment->getAttachmentFiles() as $attachmentFile) {
             $attachmentFile->delete();
         }
         $attachment->delete();
     }
     $this->delete();
 }
開發者ID:TAMULib,項目名稱:CORAL-Management,代碼行數:36,代碼來源:License.php

示例2: Attachment

     $attachment = new Attachment(new NamedArguments(array('primaryKey' => $_GET['attachmentID'])));
     //first delete attachments
     foreach ($attachment->getAttachmentFiles() as $attachmentFile) {
         $attachmentFile->delete();
     }
     try {
         $attachment->delete();
         echo "Attachment successfully deleted";
     } catch (Exception $e) {
         echo $e->getMessage();
     }
     break;
 case 'deleteAttachmentFile':
     $attachmentFile = new AttachmentFile(new NamedArguments(array('primaryKey' => $_GET['attachmentFileID'])));
     try {
         $attachmentFile->delete();
         echo "Attachment file successfully deleted";
     } catch (Exception $e) {
         echo $e->getMessage();
     }
     break;
     //updates license status when a new one is selected in dropdown box
 //updates license status when a new one is selected in dropdown box
 case 'updateStatus':
     $licenseID = $_GET['licenseID'];
     $statusID = $_GET['statusID'];
     $statusDate = date('Y-m-d H:i:s');
     //update license
     $license = new License(new NamedArguments(array('primaryKey' => $_GET['licenseID'])));
     $license->statusID = $statusID;
     $license->statusDate = $statusDate;
開發者ID:veggiematts,項目名稱:coral-licensing,代碼行數:31,代碼來源:ajax_processing.php


注:本文中的AttachmentFile::delete方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。