1, 'is_test' => 0, 'is_pay_later' => 0, 'event_id' => $eventId, 'register_date' => date('Y-m-d') . " 00:00:00", 'role_id' => 1, 'status_id' => 1, 'source' => 'Event_' . $eventId, 'contact_id' => $contactId, ); require_once 'CRM/Event/BAO/Participant.php'; $participant = CRM_Event_BAO_Participant::add($params); return $participant->id; } /** * Helper function to delete a participant * * @param int $participantId * @return boolean true if participant deleted, false otherwise */ public static function delete($participantId) { require_once 'CRM/Event/BAO/Participant.php'; return CRM_Event_BAO_Participant::deleteParticipant($participantId); } }