当前位置: 首页>>代码示例>>PHP>>正文


PHP Attachment::persist方法代码示例

本文整理汇总了PHP中Attachment::persist方法的典型用法代码示例。如果您正苦于以下问题:PHP Attachment::persist方法的具体用法?PHP Attachment::persist怎么用?PHP Attachment::persist使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Attachment的用法示例。


在下文中一共展示了Attachment::persist方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: processAddAttachmentsAction

 public function processAddAttachmentsAction()
 {
     $fileData = file_get_contents($_FILES["uploadFile"]["tmp_name"]);
     $attachment = new Attachment();
     $attachment->name = $_FILES['uploadFile']['name'];
     $attachment->attachmentReferenceId = preg_replace('[^a-zA-Z0-9-]', '//', $this->_getParam('attachmentReferenceId'));
     $attachment->mimeType = $_FILES['uploadFile']['type'];
     $attachment->md5sum = md5($fileData);
     $attachment->dateTime = date('Y-m-d H:i:s');
     $attachment->persist();
     $attachmentBlobArray = array();
     $attachmentBlobArray['attachmentId'] = $attachment->attachmentId;
     $attachmentBlobArray['data'] = $fileData;
     $db = Zend_Registry::get('dbAdapter');
     $db->insert('attachmentBlobs', $attachmentBlobArray);
     $acj = Zend_Controller_Action_HelperBroker::getStaticHelper('json');
     $acj->suppressExit = true;
     $jsonData = $acj->direct(array("attachmentId" => $attachment->attachmentId), false);
     $this->getResponse()->setHeader('Content-Type', 'text/html');
     $this->view->result = $jsonData;
     $this->render();
 }
开发者ID:dragonlet,项目名称:clearhealth,代码行数:22,代码来源:AttachmentsController.php

示例2: processAttachToNotesAction

 public function processAttachToNotesAction()
 {
     $attachmentId = (int) $this->_getParam('attachmentId');
     $attachmentReferenceId = $this->_getParam('attachmentReferenceId');
     $attachment = new Attachment();
     $attachment->attachmentId = $attachmentId;
     $attachment->populate();
     $attachment->attachmentReferenceId = $attachmentReferenceId;
     $attachment->persist();
     $json = Zend_Controller_Action_HelperBroker::getStaticHelper('json');
     $json->suppressExit = true;
     $json->direct(true);
 }
开发者ID:dragonlet,项目名称:clearhealth,代码行数:13,代码来源:MessagingController.php

示例3: flashUploadAction

 function flashUploadAction()
 {
     $attachmentReferenceId = (int) $this->_getParam('attachmentReferenceId');
     $fileData = base64_decode($this->_getParam('fileUpload'));
     $attachment = new Attachment();
     if (!isset($_FILES['uploadFile']['name'])) {
         $attachment->name = date('Y-m-d');
     } else {
         $attachment->name = $_FILES['uploadFile']['name'];
     }
     $attachment->attachmentReferenceId = $attachmentReferenceId;
     $attachment->mimeType = 'image/jpeg';
     $attachment->md5sum = md5($fileData);
     $attachment->dateTime = date('Y-m-d H:i:s');
     $attachment->persist();
     $attachmentBlobArray = array();
     $attachmentBlobArray['attachmentId'] = $attachment->attachmentId;
     $attachmentBlobArray['data'] = $fileData;
     $db = Zend_Registry::get('dbAdapter');
     $db->insert('attachmentBlobs', $attachmentBlobArray);
     $person = new Person();
     $person->personId = $attachmentReferenceId;
     $person->populate();
     $person->activePhoto = (int) $attachment->attachmentId;
     $person->persist();
     Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer')->setNoRender();
     return;
 }
开发者ID:dragonlet,项目名称:clearhealth,代码行数:28,代码来源:PatientPicturesController.php


注:本文中的Attachment::persist方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。