This documentation relates to CiviCRM version 3.2. It's not maintained anymore.
Current version of documentation.

Migrating from 1.x API to 2.x API

Skip to end of metadata
Go to start of metadata

This page refers to outdated version of CiviCRM. Check current version of documentation.


Documentation Search


CiviCRM 3.2 Documentation

Support and Participation

Developer Resources


CiviCRM book!

Make sure to check out Understanding CiviCRM as well! You can also support this project by ordering a hard copy.

This page exists to document methods for converting API code from 1.x to 2.x

This page will be expanded over time. For now, you may find additional information in the forum thread

Activity.php:

  • crm_create_activity( &$params, $activityName)
  • crm_get_contact_activities($contactID)
  • crm_update_activity( &$params,$activityName )
  • crm_delete_activity($params, $activityName)
  • _crm_update_activity($params, $daoName)
  • _crm_get_activities( $contactID, $daoName )
  • _crm_check_activity_name($activityName, $daoName)

Contact.php:

  • crm_create_contact( &$params, $contact_type = 'Individual', $dupeCheck = true )
  • crm_create_contact_formatted( &$params , $onDuplicate, $fixAddress = true )
  • crm_replace_contact_formatted($contactId, &$params)
  • crm_update_contact_formatted($contactId, &$params, $overwrite = true)
  • crm_get_contact( $params, $returnProperties = null )
  • crm_fetch_contact( $params, $returnProperties = null )
  • crm_update_contact( &$contact, $params )
  • crm_delete_contact( &$contact, $userId = null )
  • crm_contact_groups( &$contact, $status = null )
  • crm_get_contacts( $contactType = null )
  • crm_contact_get_groups( $contactId, $status = null, $numGroupContact = null, $count = false )
  • crm_fix_address($object)
  • crm_get_property_values( $name )
  • crm_create_profile_contact( $params, $fields, $ufGroupId, $contactID = null, $addToGroupID = null )

Contribution.php:

  • crm_create_contribution( &$params )
  • crm_create_contribution_formatted( &$params , $onDuplicate)
  • crm_replace_contribution_formatted($contributionId, &$params)
  • crm_update_contribution_formatted($contributionId, &$params, $overwrite = true)
  • crm_get_contribution( $params, $returnProperties = null )
  • crm_update_contribution( &$contribution, $params )
  • crm_delete_contribution( &$contribution )
  • crm_get_contributions()

crm.php:

  • crm_create_extended_property_group($class_name, $params)
  • crm_create_extended_property(&$property_group, $params)

CustomGroup.php:

  • crm_create_option_value($params, $customField)
  • crm_get_option_values($customField)
  • crm_get_custom_value( $params )
  • crm_update_option_value($params , $option )
  • crm_delete_option_value( $option )
  • crm_get_class_properties($class_name = 'Individual', $filter = 'all')
  • crm_create_custom_group($class_name, $params)
  • crm_delete_custom_group($id)
  • crm_update_custom_group($params, $customGroup)
  • crm_create_custom_field(&$custom_group, $params)
  • crm_update_custom_field($params, $customField)
  • crm_get_custom_field( $params )
  • crm_delete_custom_field( $id )
  • crm_create_custom_value($entity_table, $entity_id, &$custom_field, &$data ,$separator = null)

Event.php:

  • crm_create_event( $params )
  • crm_get_event( $params )
  • crm_update_event( $params )
  • crm_delete_event( $eventID )

File.php:

  • crm_create_file($params)
  • crm_get_file($params)
  • crm_update_file( &$params )
  • crm_delete_file( $fileId )
  • crm_create_entity_file(&$fileID, &$entityID, $entity_table = 'civicrm_contact')
  • crm_add_file_by_entity( $name, $entityID, $entityTable = 'civicrm_contact', $params )
  • crm_get_files_by_entity($entityID, $entityTable = 'civicrm_contact', $fileID = null)
  • crm_delete_entity_file(&$params)

Group.php:

  • crm_create_group($params)
  • crm_get_groups($params = null, $returnProperties = null)
  • crm_update_group(&$group, $params)
  • crm_delete_group(&$group)
  • crm_add_group_contacts(&$group, &$contacts, $status = 'Added', $method = 'Admin' )
  • crm_get_group_contacts(&$group, $returnProperties = null, $status = 'Added', $sort = null, $offset = null, $row_count= null )
  • crm_delete_group_contacts(&$group, $contacts, $method = 'Admin')
  • crm_subscribe_group_contacts(&$group, $contacts)
  • crm_confirm_group_contacts(&$group, $contacts)

History.php:

  • crm_create_activity_history(&$params)
  • crm_get_activity_history(&$params, $offset = null, $numRow = null, $sort = null)
  • crm_get_activity_history_object(&$params, &$defaults)
  • crm_update_activity_history(&$historyDAO, &$params)
  • crm_delete_activity_history(&$historyDAO)
  • _crm_check_activity_history_object(&$historyDAO, $checkForId=false)

Location.php:

  • crm_create_location(&$contact, $params)
  • crm_update_location(&$contact, $location_id, $params)
  • crm_delete_location(&$contact, $location_id)
  • crm_get_locations(&$contact, $location_types = null)

Mailer.php:

  • crm_mailer_event_bounce($job, $queue, $hash, $body)
  • crm_mailer_event_unsubscribe($job, $queue, $hash)
  • crm_mailer_event_domain_unsubscribe($job, $queue, $hash)
  • crm_mailer_event_resubscribe($job, $queue, $hash)
  • crm_mailer_event_subscribe($email, $domain_id, $group_id)
  • crm_mailer_event_confirm($contact_id, $subscribe_id, $hash)
  • crm_mailer_event_reply($job_id, $queue_id, $hash, $body, $replyto)
  • crm_mailer_event_forward($job_id, $queue_id, $hash, $email)

Membership.php:

  • crm_create_membership_type($params)
  • crm_get_membership_types($params)
  • crm_update_membership_type( $params )
  • crm_delete_membership_type( $membershipTypeID )
  • crm_create_membership_status($params)
  • crm_get_membership_statuses($params)
  • crm_update_membership_status( $params )
  • crm_delete_membership_status( $membershipStatusID )
  • crm_create_contact_membership($params, $contactID)
  • crm_update_contact_membership($params)
  • crm_get_contact_memberships($contactID)
  • crm_delete_membership($membershipID)
  • crm_calc_membership_status( $membershipID )

Note.php:

  • crm_create_note( &$params )
  • crm_get_note( &$params )
  • crm_delete_note( &$params )
  • crm_update_note( &$params )

Participant.php:

  • crm_create_participant($params, $contactID)
  • crm_get_participants( $params )
  • crm_update_participant($params)
  • crm_delete_participant($participantID)
  • crm_create_participant_payment($params)
  • crm_update_participant_payment($params)
  • crm_delete_participant_payment($participantPaymentID)
  • crm_create_participant_formatted( &$params , $onDuplicate )
  • crm_update_participant_formatted( &$params, $overwrite = true)

Relationship.php:

  • crm_create_relationship($contact =null, $target_contact= null, $relationship_type_name, $params)
  • crm_get_relationships($contact_a,
  • crm_delete_relationship(&$contact, &$target_contact, $relationship_type)
  • crm_create_relationship_type($params)
  • crm_get_relationship_types()
  • crm_update_relationship(&$relationship, $params )

Search.php:

  • crm_contact_search_count( &$params )
  • crm_contact_search() becomes civicrm_contact_search()
  • crm_search_count( &$params )
  • Search.php: * to the calling function. This matches the new search format
  • crm_search( &$params, $return_properties = null, $sort = null, $offset = 0, $row_count = 25)

Tag.php:

  • crm_create_tag($params)
  • crm_get_tag($params)
  • crm_delete_tag(&$tag)
  • crm_create_entity_tag(&$tag, &$entity)
  • crm_get_entities_by_tag(&$tag, $entity_type = null)
  • crm_tags_by_entity(&$entity)
  • crm_delete_entity_tag(&$entity_tag)

UFGroup.php:

  • crm_uf_get_profile_groups( )
  • crm_uf_get_profile_title ( $id )
  • crm_uf_get_profile_fields ( $id, $register = false, $action = null, $visibility = null )
  • crm_uf_get_profile_html ( $userID, $title, $action = null, $register = false, $reset = false )
  • crm_uf_get_profile_html_by_id ( $userID,
  • crm_uf_get_create_html ( $reset = false )
  • crm_uf_get_match_id ( $ufID )
  • crm_uf_get_uf_id ( $contactID )
  • crm_create_uf_group( $params )
  • crm_update_uf_group( $params ,$ufGroup)
  • crm_create_uf_field( $UFGroup , $params )
  • crm_update_uf_field( $params , $ufField)
  • crm_delete_uf_group( $ufGroup )
  • crm_delete_uf_field( $ufField )
  • crm_validate_profile_html($userID, $title, $action = null, $register = false)

UFJoin.php:

  • crm_add_uf_join($params)
  • crm_edit_uf_join(&$ufJoin, &$params)
  • crm_find_uf_join_id(&$params)
  • crm_find_uf_join_UFGroupId(&$params)

utils.php:

  • _crm_error( $message, $code = 8000, $level = 'Fatal', $params = null)
  • _crm_store_values( &$fields, &$params, &$values )
  • _crm_update_object(&$object, &$values)
  • _crm_update_from_object(&$object, &$values, $empty = false, $zeroMoney = false)
  • _crm_check_params( &$params, $contact_type = 'Individual', $dupeCheck = true )
  • _crm_check_contrib_params( &$params )
  • _crm_format_params( &$params, &$values )
  • _crm_format_contrib_params( &$params, &$values, $create=false )
  • _crm_format_participant_params( &$params, &$values, $create=false)
  • _crm_format_membership_params( &$params, &$values, $create=false)
  • _crm_format_custom_params( &$params, &$values, $extends )
  • _crm_update_contact( $contact, $values, $overwrite = true )
  • _crm_update_contribution($contribution, $values, $overwrite = true)
  • _crm_check_history_params(&$params, $type='Activity')
  • _crm_check_required_fields(&$params, $daoName)
  • _crm_add_formatted_param(&$values, &$params)
  • _crm_add_formatted_contrib_param(&$values, &$params)
  • _crm_required_formatted_contact(&$params)
  • _crm_required_formatted_contribution(&$params)
  • _crm_validate_formatted_contact(&$params)
  • _crm_validate_formatted_contribution(&$params)
  • _crm_duplicate_formatted_contact(&$params)
  • _crm_duplicate_formatted_contribution(&$params)
  • _crm_location_match(&$contact, &$values)
  • _crm_add_formatted_history_param(&$values, &$params)
  • _crm_initialize( )
  • _crm_get_pseudo_constant_names( )
  • _crm_object_to_array( &$dao, &$values )
  • _crm_duplicate_formatted_participant(&$params)
Labels
  • None

Creative Commons License
Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-Share Alike 3.0 United States Licence.