/** * @param int $id * * @return bool */ public static function deleteParticipantStatusType($id) { // return early if there are participants with this status $participant = new CRM_Event_DAO_Participant(); $participant->status_id = $id; if ($participant->find()) { return FALSE; } CRM_Utils_Weight::delWeight('CRM_Event_DAO_ParticipantStatusType', $id); $dao = new CRM_Event_DAO_ParticipantStatusType(); $dao->id = $id; $dao->find(TRUE); $dao->delete(); return TRUE; }
static function deleteParticipantStatusType($id) { // return early if there are participants with this status require_once 'CRM/Event/DAO/Participant.php'; $participant = new CRM_Event_DAO_Participant(); $participant->status_id = $id; if ($participant->find()) { return false; } require_once 'CRM/Utils/Weight.php'; CRM_Utils_Weight::delWeight('CRM_Event_DAO_ParticipantStatusType', $id); $dao = new CRM_Event_DAO_ParticipantStatusType(); $dao->id = $id; $dao->find(true); $dao->delete(); return true; }