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


PHP CRM_Core_BAO_Note::del方法代码示例

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


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

/**
 * Deletes an existing note
 *
 * This API is used for deleting a note
 *
 * @params  array  $paramsarray including id of the note to be deleted
 * {@getfields note_delete}
 *
 * @return null
 * @access public
 */
function civicrm_api3_note_delete($params)
{
    $result = new CRM_Core_BAO_Note();
    return $result->del($params['id']) ? civicrm_api3_create_success() : civicrm_api3_create_error('Error while deleting Note');
}
开发者ID:hguru,项目名称:224Civi,代码行数:16,代码来源:Note.php

示例3: deleteContribution

 /**
  * Delete the indirect records associated with this contribution first.
  *
  * @param int $id
  *
  * @return mixed|null
  *   $results no of deleted Contribution on success, false otherwise
  */
 public static function deleteContribution($id)
 {
     CRM_Utils_Hook::pre('delete', 'Contribution', $id, CRM_Core_DAO::$_nullArray);
     $transaction = new CRM_Core_Transaction();
     $results = NULL;
     //delete activity record
     $params = array('source_record_id' => $id, 'activity_type_id' => 6);
     CRM_Activity_BAO_Activity::deleteActivity($params);
     //delete billing address if exists for this contribution.
     self::deleteAddress($id);
     //update pledge and pledge payment, CRM-3961
     CRM_Pledge_BAO_PledgePayment::resetPledgePayment($id);
     // remove entry from civicrm_price_set_entity, CRM-5095
     if (CRM_Price_BAO_PriceSet::getFor('civicrm_contribution', $id)) {
         CRM_Price_BAO_PriceSet::removeFrom('civicrm_contribution', $id);
     }
     // cleanup line items.
     $participantId = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_ParticipantPayment', $id, 'participant_id', 'contribution_id');
     // delete any related entity_financial_trxn, financial_trxn and financial_item records.
     CRM_Core_BAO_FinancialTrxn::deleteFinancialTrxn($id);
     if ($participantId) {
         CRM_Price_BAO_LineItem::deleteLineItems($participantId, 'civicrm_participant');
     } else {
         CRM_Price_BAO_LineItem::deleteLineItems($id, 'civicrm_contribution');
     }
     //delete note.
     $note = CRM_Core_BAO_Note::getNote($id, 'civicrm_contribution');
     $noteId = key($note);
     if ($noteId) {
         CRM_Core_BAO_Note::del($noteId, FALSE);
     }
     $dao = new CRM_Contribute_DAO_Contribution();
     $dao->id = $id;
     $results = $dao->delete();
     $transaction->commit();
     CRM_Utils_Hook::post('delete', 'Contribution', $dao->id, $dao);
     // delete the recently created Contribution
     $contributionRecent = array('id' => $id, 'type' => 'Contribution');
     CRM_Utils_Recent::del($contributionRecent);
     return $results;
 }
开发者ID:nganivet,项目名称:civicrm-core,代码行数:49,代码来源:Contribution.php

示例4: postProcess

 /**
  *
  * @access public
  * @return None
  */
 public function postProcess()
 {
     // store the submitted values in an array
     $params = $this->exportValues();
     $session =& CRM_Core_Session::singleton();
     $params['contact_id'] = $session->get('userID');
     $params['entity_table'] = $this->_entityTable;
     $params['entity_id'] = $this->_entityId;
     if ($this->_action & CRM_Core_Action::DELETE) {
         CRM_Core_BAO_Note::del($this->_id);
         return;
     }
     if ($this->_action & CRM_Core_Action::UPDATE) {
         $params['id'] = $this->_id;
     }
     $ids = array();
     require_once 'CRM/Core/BAO/Note.php';
     CRM_Core_BAO_Note::add($params, $ids);
     CRM_Core_Session::setStatus(ts('Your Note has been saved.'));
 }
开发者ID:ksecor,项目名称:civicrm,代码行数:25,代码来源:Note.php

示例5: delete

 /**
  * delete the note object from the db
  *
  * @return void
  * @access public
  */
 function delete()
 {
     CRM_Core_BAO_Note::del($this->_id);
 }
开发者ID:hguru,项目名称:224Civi,代码行数:10,代码来源:Note.php

示例6: postProcess

 /**
  *
  * @access public
  *
  * @return void
  */
 public function postProcess()
 {
     // store the submitted values in an array
     $params = $this->controller->exportValues($this->_name);
     $session = CRM_Core_Session::singleton();
     $params['contact_id'] = $session->get('userID');
     if ($params['parent_id']) {
         $params['entity_table'] = 'civicrm_note';
         $params['entity_id'] = $params['parent_id'];
     } else {
         $params['entity_table'] = $this->_entityTable;
         $params['entity_id'] = $this->_entityId;
     }
     if ($this->_action & CRM_Core_Action::DELETE) {
         CRM_Core_BAO_Note::del($this->_id);
         return;
     }
     $params['id'] = null;
     if ($this->_action & CRM_Core_Action::UPDATE) {
         $params['id'] = $this->_id;
     }
     // add attachments as needed
     CRM_Core_BAO_File::formatAttachment($params, $params, 'civicrm_note', $params['id']);
     $ids = array();
     $note = CRM_Core_BAO_Note::add($params, $ids);
     CRM_Core_Session::setStatus(ts('Your Note has been saved.'), ts('Saved'), 'success');
 }
开发者ID:prashantgajare,项目名称:civicrm-core,代码行数:33,代码来源:Note.php

示例7: postProcess

 /**
  *
  * @access public
  * @return None
  */
 function postProcess()
 {
     $session =& CRM_Core_Session::singleton();
     // store the submitted values in an array
     $params = $this->exportValues();
     // action is taken depending upon the mode
     $note =& new CRM_Core_DAO_Note();
     $note->note = $params['note'];
     $note->contact_id = $session->get('userID');
     if (!$note->contact_id) {
         CRM_Utils_System::statusBounce(ts('We could not find your logged in user ID'));
     }
     $note->modified_date = date("Ymd");
     if ($this->_action & CRM_CORE_ACTION_DELETE) {
         CRM_Core_BAO_Note::del($this->_id);
         //CRM_Core_Session::setStatus( ts('Selected Note has been Deleted Successfuly.') );
         return;
     }
     if ($this->_action & CRM_CORE_ACTION_UPDATE) {
         $note->id = $this->_id;
     } else {
         $note->entity_table = $this->_entityTable;
         $note->entity_id = $this->_entityId;
     }
     $note->save();
     CRM_Core_Session::setStatus(ts('Your Note has been saved.'));
 }
开发者ID:bhirsch,项目名称:voipdrupal-4.7-1.0,代码行数:32,代码来源:Note.php

示例8: civicrm_note_delete

/**
 * Deletes an existing note
 * 
 * This API is used for deleting a note
 * 
 * @param  Int  $noteID   Id of the note to be deleted
 * 
 * @return null
 * @access public
 */
function civicrm_note_delete(&$params)
{
    _civicrm_initialize();
    if (!is_array($params)) {
        $error = civicrm_create_error('Params is not an array');
        return $error;
    }
    if (!CRM_Utils_Array::value('id', $params)) {
        $error = civicrm_create_error('Invalid or no value for Note ID');
        return $error;
    }
    $result = new CRM_Core_BAO_Note();
    return $result->del($params['id']) ? civicrm_create_success() : civicrm_create_error('Error while deleting Note');
}
开发者ID:ksecor,项目名称:civicrm,代码行数:24,代码来源:Note.php


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