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


PHP CRM_Event_DAO_Participant::delete方法代码示例

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


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

示例1: deleteParticipant

 /**
  * Delete the records that are associated with this participation.
  *
  * @param int $id
  *   Id of the participation to delete.
  *
  * @return \CRM_Event_DAO_Participant
  */
 public static function deleteParticipant($id)
 {
     CRM_Utils_Hook::pre('delete', 'Participant', $id, CRM_Core_DAO::$_nullArray);
     $transaction = new CRM_Core_Transaction();
     //delete activity record
     $params = array('source_record_id' => $id, 'activity_type_id' => 5);
     CRM_Activity_BAO_Activity::deleteActivity($params);
     // delete the participant payment record
     // we need to do this since the cascaded constraints
     // dont work with join tables
     $p = array('participant_id' => $id);
     CRM_Event_BAO_ParticipantPayment::deleteParticipantPayment($p);
     // cleanup line items.
     $participantsId = array();
     $participantsId = self::getAdditionalParticipantIds($id);
     $participantsId[] = $id;
     CRM_Price_BAO_LineItem::deleteLineItems($participantsId, 'civicrm_participant');
     //delete note when participant deleted.
     $note = CRM_Core_BAO_Note::getNote($id, 'civicrm_participant');
     $noteId = key($note);
     if ($noteId) {
         CRM_Core_BAO_Note::del($noteId, FALSE);
     }
     $participant = new CRM_Event_DAO_Participant();
     $participant->id = $id;
     $participant->delete();
     $transaction->commit();
     CRM_Utils_Hook::post('delete', 'Participant', $participant->id, $participant);
     // delete the recently created Participant
     $participantRecent = array('id' => $id, 'type' => 'Participant');
     CRM_Utils_Recent::del($participantRecent);
     return $participant;
 }
开发者ID:kcristiano,项目名称:civicrm-core,代码行数:41,代码来源:Participant.php

示例2: deleteParticipant

 /**                          
  * Delete the record that are associated with this participation
  * 
  * @param  int  $id id of the participation to delete                                                                           
  * 
  * @return void
  * @access public 
  * @static 
  */
 static function deleteParticipant($id)
 {
     require_once 'CRM/Core/Transaction.php';
     $transaction = new CRM_Core_Transaction();
     //delete activity record
     require_once "CRM/Activity/BAO/Activity.php";
     $params = array('source_record_id' => $id, 'activity_type_id' => 5);
     // activity type id for event registration
     CRM_Activity_BAO_Activity::deleteActivity($params);
     // delete the participant payment record
     // we need to do this since the cascaded constraints
     // dont work with join tables
     require_once 'CRM/Event/BAO/ParticipantPayment.php';
     $p = array('participant_id' => $id);
     CRM_Event_BAO_ParticipantPayment::deleteParticipantPayment($p);
     // cleanup line items.
     require_once 'CRM/Price/BAO/LineItem.php';
     $participantsId = array();
     $participantsId = self::getAdditionalParticipantIds($id);
     $participantsId[] = $id;
     CRM_Price_BAO_LineItem::deleteLineItems($participantsId, 'civicrm_participant');
     $participant = new CRM_Event_DAO_Participant();
     $participant->id = $id;
     $participant->delete();
     $transaction->commit();
     // delete the recently created Participant
     require_once 'CRM/Utils/Recent.php';
     $participantRecent = array('id' => $id, 'type' => 'Participant');
     CRM_Utils_Recent::del($participantRecent);
     return $participant;
 }
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:40,代码来源:Participant.php


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