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


PHP CRM_Core_BAO_File::deleteEntityFile方法代码示例

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


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

示例1: fileDelete

 function fileDelete()
 {
     // delete file
     $postParams = $_POST;
     $fileId = $postParams['fileID'];
     CRM_Core_BAO_File::deleteEntityFile($postParams['entityTable'], $postParams['entityID'], $fileTypeID = NULL, $fileId);
     CRM_Utils_System::civiExit();
 }
开发者ID:JoeMurray,项目名称:civihr,代码行数:8,代码来源:Files.php

示例2: deleteAttachment

 /**
  * function to delete a file attachment from an entity table / entity ID
  *
  * @static
  * @access public
  */
 static function deleteAttachment()
 {
     $params = array();
     $params['entityTable'] = CRM_Utils_Request::retrieve('entityTable', 'String', CRM_Core_DAO::$_nullObject, TRUE);
     $params['entityID'] = CRM_Utils_Request::retrieve('entityID', 'Positive', CRM_Core_DAO::$_nullObject, TRUE);
     $params['fileID'] = CRM_Utils_Request::retrieve('fileID', 'Positive', CRM_Core_DAO::$_nullObject, TRUE);
     $signature = CRM_Utils_Request::retrieve('_sgn', 'String', CRM_Core_DAO::$_nullObject, TRUE);
     $signer = new CRM_Utils_Signer(CRM_Core_Key::privateKey(), self::$_signableFields);
     if (!$signer->validate($signature, $params)) {
         CRM_Core_Error::fatal('Request signature is invalid');
     }
     CRM_Core_BAO_File::deleteEntityFile($params['entityTable'], $params['entityID'], NULL, $params['fileID']);
 }
开发者ID:hguru,项目名称:224Civi,代码行数:19,代码来源:File.php

示例3: del

 /**
  * Delete Mails and all its associated records.
  *
  * @param int $id
  *   Id of the mail to delete.
  *
  * @return void
  */
 public static function del($id)
 {
     if (empty($id)) {
         CRM_Core_Error::fatal();
     }
     CRM_Utils_Hook::pre('delete', 'Mailing', $id, CRM_Core_DAO::$_nullArray);
     // delete all file attachments
     CRM_Core_BAO_File::deleteEntityFile('civicrm_mailing', $id);
     $dao = new CRM_Mailing_DAO_Mailing();
     $dao->id = $id;
     $dao->delete();
     CRM_Core_Session::setStatus(ts('Selected mailing has been deleted.'), ts('Deleted'), 'success');
     CRM_Utils_Hook::post('delete', 'Mailing', $id, $dao);
 }
开发者ID:scardinius,项目名称:civicrm-core-api-mailing,代码行数:22,代码来源:Mailing.php

示例4: formatAttachment

 static function formatAttachment(&$formValues, &$params, $entityTable, $entityID = NULL)
 {
     // delete current attachments if applicable
     if ($entityID && CRM_Utils_Array::value('is_delete_attachment', $formValues)) {
         CRM_Core_BAO_File::deleteEntityFile($entityTable, $entityID);
     }
     $config = CRM_Core_Config::singleton();
     $numAttachments = $config->maxAttachments;
     $now = date('Ymdhis');
     // setup all attachments
     for ($i = 1; $i <= $numAttachments; $i++) {
         $attachName = "attachFile_{$i}";
         if (isset($formValues[$attachName]) && !empty($formValues[$attachName])) {
             // we dont care if the file is empty or not
             // CRM-7448
             $fileParams = array('uri' => $formValues[$attachName]['name'], 'type' => $formValues[$attachName]['type'], 'location' => $formValues[$attachName]['name'], 'upload_date' => $now);
             $params[$attachName] = $fileParams;
         }
     }
 }
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:20,代码来源:File.php

示例5: del

 /**
  * Delete Mails and all its associated records
  *
  * @param  int  $id id of the mail to delete
  *
  * @return void
  * @access public
  * @static
  */
 public static function del($id)
 {
     if (empty($id)) {
         CRM_Core_Error::fatal();
     }
     // delete all file attachments
     CRM_Core_BAO_File::deleteEntityFile('civicrm_mailing', $id);
     $dao = new CRM_Mailing_DAO_Mailing();
     $dao->id = $id;
     $dao->delete();
     CRM_Core_Session::setStatus(ts('Selected mailing has been deleted.'));
 }
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:21,代码来源:Mailing.php

示例6: formatAttachment

 static function formatAttachment(&$formValues, &$params, $entityTable, $entityID = null)
 {
     // delete current attachments if applicable
     if ($entityID && CRM_Utils_Array::value('is_delete_attachment', $formValues)) {
         CRM_Core_BAO_File::deleteEntityFile($entityTable, $entityID);
     }
     $config =& CRM_Core_Config::singleton();
     $numAttachments = $config->maxAttachments;
     // setup all attachments
     for ($i = 1; $i <= $numAttachments; $i++) {
         $attachName = "attachFile_{$i}";
         if (isset($formValues[$attachName]) && !empty($formValues[$attachName])) {
             // ensure file is not empty
             $contents = file_get_contents($formValues[$attachName]['name']);
             if ($contents) {
                 $fileParams = array('uri' => $formValues[$attachName]['name'], 'type' => $formValues[$attachName]['type'], 'upload_date' => date('Ymdhis'), 'location' => $formValues[$attachName]['name']);
                 $params[$attachName] = $fileParams;
             }
         }
     }
 }
开发者ID:ksecor,项目名称:civicrm,代码行数:21,代码来源:File.php

示例7: civicrm_api3_file_delete

/**
 * Delete an existing File.
 *
 * @param array $params
 *   Array per getfields metadata.
 *
 * @return array
 *   API Result Array
 */
function civicrm_api3_file_delete($params)
{
    civicrm_api3_verify_mandatory($params, NULL, array('id'));
    if (CRM_Core_BAO_File::deleteEntityFile('*', $params['id'])) {
        return civicrm_api3_create_success();
    } else {
        throw new API_Exception('Error while deleting a file.');
    }
}
开发者ID:nielosz,项目名称:civicrm-core,代码行数:18,代码来源:File.php

示例8: fileDelete

 public static function fileDelete()
 {
     $postParams = $_GET;
     $fileId = $postParams['fileID'];
     $result = 0;
     CRM_Core_BAO_File::deleteEntityFile($postParams['entityTable'], $postParams['entityID'], $fileTypeID = NULL, $fileId);
     list($path) = CRM_Core_BAO_File::path($fileId, $postParams['entityID'], NULL, NULL);
     if ($path === null) {
         $result = 1;
     }
     echo html_entity_decode(stripcslashes(json_encode(array('values' => array(array('result' => $result))), true)));
     CRM_Utils_System::civiExit();
 }
开发者ID:JoeMurray,项目名称:civihr,代码行数:13,代码来源:Files.php


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