This is not an exhaustive update. It covers a good chunk of the common changes but a lot of copy & paste means the examples are being overwritten by other tests. I have removed some of that
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
'campaign_id' => '',
'engagement_level' => '',
'weight' => '',
+ 'is_star' => '',
),
),
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
'is_auto' => 0,
'is_current_revision' => '1',
'is_deleted' => 0,
+ 'is_star' => 0,
'source_contact_id' => '1',
),
),
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
'is_auto' => 0,
'is_current_revision' => '1',
'is_deleted' => 0,
+ 'is_star' => 0,
'source_contact_id' => '1',
),
),
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$expectedResult = array(
'is_error' => 0,
'version' => 3,
- 'count' => 27,
+ 'count' => 29,
'values' => array(
'source_record_id' => array(
'name' => 'source_record_id',
'type' => 1,
'title' => 'Source Record',
+ 'description' => 'Artificial FK to original transaction (e.g. contribution) IF it is not an Activity. Table can be figured out through activity_type_id, and further through component registry.',
),
'activity_type_id' => array(
'name' => 'activity_type_id',
'type' => 1,
'title' => 'Activity Type ID',
+ 'description' => 'FK to civicrm_option_value.id, that has to be valid, registered activity type.',
'required' => TRUE,
'import' => TRUE,
'where' => 'civicrm_activity.activity_type_id',
'default' => '1',
'html' => array(
'type' => 'Select',
+ 'size' => 6,
+ 'maxlength' => 14,
),
'pseudoconstant' => array(
'optionGroupName' => 'activity_type',
+ 'optionEditPath' => 'civicrm/admin/options/activity_type',
),
),
'activity_date_time' => array(
'name' => 'activity_date_time',
'type' => 12,
'title' => 'Activity Date',
+ 'description' => 'Date and time this activity is scheduled to occur. Formerly named scheduled_date_time.',
'import' => TRUE,
'where' => 'civicrm_activity.activity_date_time',
'headerPattern' => '/(activity.)?date(.time$)?/i',
'name' => 'phone_id',
'type' => 1,
'title' => 'Phone (called) ID',
+ 'description' => 'Phone ID of the number called (optional - used if an existing phone number is selected).',
'FKClassName' => 'CRM_Core_DAO_Phone',
'html' => array(
- 'type' => 'Autocomplete-Select',
+ 'type' => 'EntityRef',
+ 'size' => 6,
+ 'maxlength' => 14,
),
'FKApiName' => 'Phone',
),
'name' => 'phone_number',
'type' => 2,
'title' => 'Phone (called) Number',
+ 'description' => 'Phone number in case the number does not exist in the civicrm_phone table.',
'maxlength' => 64,
'size' => 30,
'html' => array(
'type' => 'Text',
+ 'maxlength' => 64,
+ 'size' => 30,
),
),
'priority_id' => array(
'name' => 'priority_id',
'type' => 1,
'title' => 'Priority',
+ 'description' => 'ID of the priority given to this activity. Foreign key to civicrm_option_value.',
'html' => array(
'type' => 'Select',
+ 'size' => 6,
+ 'maxlength' => 14,
),
'pseudoconstant' => array(
'optionGroupName' => 'priority',
+ 'optionEditPath' => 'civicrm/admin/options/priority',
),
),
'parent_id' => array(
'name' => 'parent_id',
'type' => 1,
'title' => 'Parent Activity Id',
+ 'description' => 'Parent meeting ID (if this is a follow-up item). This is not currently implemented',
'FKClassName' => 'CRM_Activity_DAO_Activity',
'FKApiName' => 'Activity',
),
'name' => 'relationship_id',
'type' => 1,
'title' => 'Relationship Id',
+ 'description' => 'FK to Relationship ID',
'default' => 'NULL',
'FKClassName' => 'CRM_Contact_DAO_Relationship',
'FKApiName' => 'Relationship',
'name' => 'original_id',
'type' => 1,
'title' => 'Original Activity ID ',
+ 'description' => 'Activity ID of the first activity record in versioning chain.',
'FKClassName' => 'CRM_Activity_DAO_Activity',
'FKApiName' => 'Activity',
),
'title' => 'Order',
'html' => array(
'type' => 'Text',
+ 'size' => 6,
+ 'maxlength' => 14,
),
),
+ 'is_star' => array(
+ 'name' => 'is_star',
+ 'type' => 16,
+ 'title' => 'Is Starred',
+ 'description' => 'Activity marked as favorite.',
+ 'import' => TRUE,
+ 'where' => 'civicrm_activity.is_star',
+ 'headerPattern' => '/(activity.)?(star|favorite)/i',
+ 'export' => TRUE,
+ ),
'id' => array(
'name' => 'id',
'type' => 1,
'title' => 'Activity ID',
+ 'description' => 'Unique Other Activity ID',
'required' => TRUE,
'import' => TRUE,
'where' => 'civicrm_activity.id',
'name' => 'subject',
'type' => 2,
'title' => 'Subject',
+ 'description' => 'The subject/purpose/short description of the activity.',
'maxlength' => 255,
'size' => 45,
'import' => TRUE,
'export' => TRUE,
'html' => array(
'type' => 'Text',
+ 'maxlength' => 255,
+ 'size' => 45,
),
'uniqueName' => 'activity_subject',
),
'name' => 'duration',
'type' => 1,
'title' => 'Duration',
+ 'description' => 'Planned or actual duration of activity expressed in minutes. Conglomerate of former duration_hours and duration_minutes.',
'import' => TRUE,
'where' => 'civicrm_activity.duration',
'headerPattern' => '/(activity.)?duration(s)?$/i',
'export' => TRUE,
'html' => array(
'type' => 'Text',
+ 'size' => 6,
+ 'maxlength' => 14,
),
'uniqueName' => 'activity_duration',
),
'name' => 'location',
'type' => 2,
'title' => 'Location',
+ 'description' => 'Location of the activity (optional, open text).',
'maxlength' => 255,
'size' => 45,
'import' => TRUE,
'export' => TRUE,
'html' => array(
'type' => 'Text',
+ 'maxlength' => 255,
+ 'size' => 45,
),
'uniqueName' => 'activity_location',
),
'name' => 'details',
'type' => 32,
'title' => 'Details',
- 'rows' => 8,
- 'cols' => 60,
+ 'description' => 'Details about the activity (agenda, notes, etc).',
'import' => TRUE,
'where' => 'civicrm_activity.details',
'headerPattern' => '/(activity.)?detail(s)?$/i',
'export' => TRUE,
'html' => array(
'type' => 'RichTextEditor',
+ 'rows' => 2,
+ 'cols' => 80,
),
'uniqueName' => 'activity_details',
),
'name' => 'status_id',
'type' => 1,
'title' => 'Activity Status',
+ 'description' => 'ID of the status this activity is currently in. Foreign key to civicrm_option_value.',
'import' => TRUE,
'where' => 'civicrm_activity.status_id',
'headerPattern' => '/(activity.)?status(.label$)?/i',
'html' => array(
'type' => 'Select',
+ 'size' => 6,
+ 'maxlength' => 14,
),
'pseudoconstant' => array(
'optionGroupName' => 'activity_status',
+ 'optionEditPath' => 'civicrm/admin/options/activity_status',
),
'uniqueName' => 'activity_status_id',
'api.aliases' => array(
'name' => 'medium_id',
'type' => 1,
'title' => 'Activity Medium',
+ 'description' => 'Activity Medium, Implicit FK to civicrm_option_value where option_group = encounter_medium.',
'default' => 'NULL',
'html' => array(
'type' => 'Select',
+ 'size' => 6,
+ 'maxlength' => 14,
),
'pseudoconstant' => array(
'optionGroupName' => 'encounter_medium',
+ 'optionEditPath' => 'civicrm/admin/options/encounter_medium',
),
'uniqueName' => 'activity_medium_id',
),
'name' => 'result',
'type' => 2,
'title' => 'Result',
+ 'description' => 'Currently being used to store result id for survey activity, FK to option value.',
'maxlength' => 255,
'size' => 45,
'html' => array(
'type' => 'Text',
+ 'maxlength' => 255,
+ 'size' => 45,
),
'uniqueName' => 'activity_result',
),
'name' => 'campaign_id',
'type' => 1,
'title' => 'Campaign',
+ 'description' => 'The campaign for which this activity has been triggered.',
'import' => TRUE,
'where' => 'civicrm_activity.campaign_id',
'export' => TRUE,
'FKClassName' => 'CRM_Campaign_DAO_Campaign',
'html' => array(
'type' => 'CheckBox',
+ 'size' => 6,
+ 'maxlength' => 14,
),
'pseudoconstant' => array(
'table' => 'civicrm_campaign',
'name' => 'engagement_level',
'type' => 1,
'title' => 'Engagement Index',
+ 'description' => 'Assign a specific level of engagement to this activity. Used for tracking constituents in ladder of engagement.',
'import' => TRUE,
'where' => 'civicrm_activity.engagement_level',
'export' => TRUE,
'html' => array(
'type' => 'Select',
+ 'size' => 6,
+ 'maxlength' => 14,
),
'pseudoconstant' => array(
'optionGroupName' => 'engagement_index',
+ 'optionEditPath' => 'civicrm/admin/options/engagement_index',
),
'uniqueName' => 'activity_engagement_level',
),
'source_contact_id' => array(
'name' => 'source_contact_id',
'title' => 'Activity Source Contact',
+ 'description' => 'Person who created this activity. Defaults to current user.',
'type' => 1,
- 'FKClassName' => 'CRM_Activity_DAO_ActivityContact',
+ 'FKClassName' => 'CRM_Contact_DAO_Contact',
'api.default' => 'user_contact_id',
+ 'FKApiName' => 'Contact',
),
'assignee_contact_id' => array(
'name' => 'assignee_id',
- 'title' => 'assigned to',
+ 'title' => 'Activity Assignee',
+ 'description' => 'Contact(s) assigned to this activity.',
'type' => 1,
- 'FKClassName' => 'CRM_Activity_DAO_ActivityContact',
+ 'FKClassName' => 'CRM_Contact_DAO_Contact',
+ 'FKApiName' => 'Contact',
),
'target_contact_id' => array(
'name' => 'target_id',
'title' => 'Activity Target',
+ 'description' => 'Contact(s) participating in this activity.',
+ 'type' => 1,
+ 'FKClassName' => 'CRM_Contact_DAO_Contact',
+ 'FKApiName' => 'Contact',
+ ),
+ 'case_id' => array(
+ 'name' => 'case_id',
+ 'title' => 'Case ID',
+ 'description' => 'For creating an activity as part of a case.',
'type' => 1,
- 'FKClassName' => 'CRM_Activity_DAO_ActivityContact',
+ 'FKClassName' => 'CRM_Case_DAO_Case',
+ 'FKApiName' => 'Case',
),
),
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
'campaign_id' => '',
'engagement_level' => '',
'weight' => '',
+ 'is_star' => '',
),
),
);
$params = array(
'id' => 1,
'return' => array(
- 'subject',
- 'source_contact_name',
- 'target_contact_name',
- 'assignee_contact_name',
+ '0' => 'source_contact_name',
+ '1' => 'target_contact_name',
+ '2' => 'assignee_contact_name',
+ '3' => 'subject',
),
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
'is_auto' => 0,
'is_current_revision' => '1',
'is_deleted' => 0,
+ 'is_star' => 0,
'assignee_contact_id' => array(
'0' => '3',
),
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
'19' => 'Bulk Email',
'20' => 'Assign Case Role',
'21' => 'Remove Case Role',
- '22' => 'Print PDF Letter',
+ '22' => 'Print/Merge Document',
'23' => 'Merge Case',
'24' => 'Reassigned Case',
'25' => 'Link Cases',
'48' => 'Change Registration',
'49' => 'Downloaded Invoice',
'50' => 'Emailed Invoice',
+ '51' => 'Contact Merged',
+ '52' => 'Contact Deleted by Merge',
+ '53' => 'Failed Payment',
+ '54' => 'Close Accounting Period',
),
'deprecated' => 'The ActivityType api is deprecated. Please use the OptionValue api instead.',
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
'is_error' => 0,
'version' => 3,
'count' => 1,
- 'values' => TRUE,
+ 'values' => 1,
);
return $expectedResult;
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
'is_error' => 0,
'version' => 3,
'count' => 1,
- 'values' => TRUE,
+ 'values' => 1,
);
return $expectedResult;
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
--- /dev/null
+<?php
+/**
+ * Test Generated example demonstrating the CaseContact.get API.
+ *
+ * @return array
+ * API result array
+ */
+function case_contact_get_example() {
+ $params = array(
+ 'contact_id' => 19,
+ );
+
+ try{
+ $result = civicrm_api3('CaseContact', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
+}
+
+/**
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
+ */
+function case_contact_get_expectedresult() {
+
+ $expectedResult = array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 2,
+ 'values' => array(
+ '2' => array(
+ 'id' => '2',
+ 'case_id' => '2',
+ 'contact_id' => '19',
+ ),
+ ),
+ );
+
+ return $expectedResult;
+}
+
+/*
+* This example has been generated from the API test suite.
+* The test that created it is called "testCaseContactGet"
+* and can be found at:
+* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/CaseContactTest.php
+*
+* You can see the outcome of the API tests at
+* https://test.civicrm.org/job/CiviCRM-master-git/
+*
+* To Learn about the API read
+* http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
+*
+* Browse the api on your own site with the api explorer
+* http://MYSITE.ORG/path/to/civicrm/api
+*
+* Read more about testing here
+* http://wiki.civicrm.org/confluence/display/CRM/Testing
+*
+* API Standards documentation:
+* http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
+*/
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
'12' => 'Inbound Email',
'17' => 'Membership Renewal Reminder',
'19' => 'Bulk Email',
- '22' => 'Print PDF Letter',
+ '22' => 'Print/Merge Document',
'34' => 'Mass SMS',
'35' => 'Change Membership Status',
'36' => 'Change Membership Type',
'48' => 'Change Registration',
'49' => 'Downloaded Invoice',
'50' => 'Emailed Invoice',
+ '51' => 'Contact Merged',
+ '52' => 'Contact Deleted by Merge',
+ '53' => 'Failed Payment',
+ '54' => 'Close Accounting Period',
),
'deprecated' => 'The Constant api is deprecated as of CiviCRM 4.4. Please use the getoptions api action instead.',
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
'is_opt_out' => 0,
'legal_identifier' => '',
'external_identifier' => '',
- 'sort_name' => '',
+ 'sort_name' => 'batman',
'display_name' => 'batman',
'nick_name' => '',
'legal_name' => '',
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
'campaign_id' => '',
'creditnote_id' => '',
'tax_amount' => '',
+ 'revenue_recognition_date' => '',
'contribution_type_id' => '1',
),
),
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
'campaign_id' => '',
'creditnote_id' => '',
'tax_amount' => '',
+ 'revenue_recognition_date' => '',
'contribution_type_id' => '1',
),
),
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$expectedResult = array(
'is_error' => 0,
'version' => 3,
- 'count' => 23,
+ 'count' => 25,
'values' => array(
'0' => 'create',
'1' => 'delete',
- '2' => 'example_action1',
- '3' => 'example_action2',
- '4' => 'get',
- '5' => 'getactions',
- '6' => 'getcount',
- '7' => 'getfields',
- '8' => 'getlist',
- '9' => 'getoptions',
- '10' => 'getquick',
- '11' => 'getrefcount',
- '12' => 'getsingle',
- '13' => 'getstat',
- '14' => 'getvalue',
- '15' => 'merge',
- '16' => 'proximity',
- '17' => 'replace',
- '18' => 'setvalue',
- '19' => 'type_create',
- '20' => 'type_delete',
- '21' => 'type_get',
- '22' => 'update',
+ '2' => 'duplicatecheck',
+ '3' => 'example_action1',
+ '4' => 'example_action2',
+ '5' => 'get',
+ '6' => 'getactions',
+ '7' => 'getcount',
+ '8' => 'getfield',
+ '9' => 'getfields',
+ '10' => 'getlist',
+ '11' => 'getoptions',
+ '12' => 'getquick',
+ '13' => 'getrefcount',
+ '14' => 'getsingle',
+ '15' => 'getvalue',
+ '16' => 'merge',
+ '17' => 'proximity',
+ '18' => 'replace',
+ '19' => 'setvalue',
+ '20' => 'type_create',
+ '21' => 'type_delete',
+ '22' => 'type_get',
+ '23' => 'update',
+ '24' => 'validate',
),
'deprecated' => array(
'getquick' => 'The "getquick" action is deprecated in favor of "getlist".',
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
'id' => array(
'name' => 'id',
'type' => 1,
- 'title' => 'Internal Contact ID',
+ 'title' => 'Contact ID',
+ 'description' => 'Unique Contact ID',
'required' => TRUE,
'import' => TRUE,
'where' => 'civicrm_contact.id',
'name' => 'contact_type',
'type' => 2,
'title' => 'Contact Type',
+ 'description' => 'Type of Contact.',
'maxlength' => 64,
'size' => 30,
'export' => TRUE,
'where' => 'civicrm_contact.contact_type',
'html' => array(
'type' => 'Select',
+ 'maxlength' => 64,
+ 'size' => 30,
),
'pseudoconstant' => array(
'table' => 'civicrm_contact_type',
'name' => 'contact_sub_type',
'type' => 2,
'title' => 'Contact Subtype',
+ 'description' => 'May be used to over-ride contact view and edit templates.',
'maxlength' => 255,
'size' => 45,
'import' => TRUE,
'headerPattern' => '/C(ontact )?(subtype|sub-type|sub type)/i',
'export' => TRUE,
'html' => array(
- 'type' => 'Multi-Select',
+ 'type' => 'Select',
+ 'maxlength' => 255,
+ 'size' => 45,
),
'pseudoconstant' => array(
'table' => 'civicrm_contact_type',
'name' => 'is_opt_out',
'type' => 16,
'title' => 'No Bulk Emails (User Opt Out)',
+ 'description' => 'Has the contact opted out from receiving all bulk email from the organization or site domain?',
'required' => TRUE,
'import' => TRUE,
'where' => 'civicrm_contact.is_opt_out',
'name' => 'legal_identifier',
'type' => 2,
'title' => 'Legal Identifier',
+ 'description' => 'May be used for SSN, EIN/TIN, Household ID (census) or other applicable unique legal/government ID.
+ ',
'maxlength' => 32,
'size' => 20,
'import' => TRUE,
'export' => TRUE,
'html' => array(
'type' => 'Text',
+ 'maxlength' => 32,
+ 'size' => 20,
),
),
'external_identifier' => array(
'name' => 'external_identifier',
'type' => 2,
'title' => 'External Identifier',
+ 'description' => 'Unique trusted external ID (generally from a legacy app/datasource). Particularly useful for deduping operations.',
'maxlength' => 64,
'size' => 8,
'import' => TRUE,
'export' => TRUE,
'html' => array(
'type' => 'Text',
+ 'maxlength' => 64,
+ 'size' => 8,
),
),
'sort_name' => array(
'name' => 'sort_name',
'type' => 2,
'title' => 'Sort Name',
+ 'description' => 'Name used for sorting different contact types',
'maxlength' => 128,
'size' => 30,
'export' => TRUE,
'where' => 'civicrm_contact.sort_name',
'html' => array(
'type' => 'Text',
+ 'maxlength' => 128,
+ 'size' => 30,
),
),
'display_name' => array(
'name' => 'display_name',
'type' => 2,
'title' => 'Display Name',
+ 'description' => 'Formatted name representing preferred format for display/print/other output.',
'maxlength' => 128,
'size' => 30,
'export' => TRUE,
'where' => 'civicrm_contact.display_name',
'html' => array(
'type' => 'Text',
+ 'maxlength' => 128,
+ 'size' => 30,
),
),
'nick_name' => array(
'name' => 'nick_name',
'type' => 2,
'title' => 'Nickname',
+ 'description' => 'Nickname.',
'maxlength' => 128,
'size' => 30,
'import' => TRUE,
'export' => TRUE,
'html' => array(
'type' => 'Text',
+ 'maxlength' => 128,
+ 'size' => 30,
),
),
'legal_name' => array(
'name' => 'legal_name',
'type' => 2,
'title' => 'Legal Name',
+ 'description' => 'Legal Name.',
'maxlength' => 128,
'size' => 30,
'import' => TRUE,
'export' => TRUE,
'html' => array(
'type' => 'Text',
+ 'maxlength' => 128,
+ 'size' => 30,
),
),
'image_URL' => array(
'name' => 'image_URL',
- 'type' => 2,
+ 'type' => 32,
'title' => 'Image Url',
- 'maxlength' => 255,
- 'size' => 45,
+ 'description' => 'optional URL for preferred image (photo, logo, etc.) to display for this contact.',
'import' => TRUE,
'where' => 'civicrm_contact.image_URL',
'export' => TRUE,
'html' => array(
- 'type' => 'Text',
+ 'type' => 'File',
+ 'rows' => 2,
+ 'cols' => 80,
),
),
'preferred_communication_method' => array(
'name' => 'preferred_communication_method',
'type' => 2,
'title' => 'Preferred Communication Method',
+ 'description' => 'What is the preferred mode of communication.',
'maxlength' => 255,
'size' => 45,
'import' => TRUE,
'export' => TRUE,
'html' => array(
'type' => 'Select',
+ 'maxlength' => 255,
+ 'size' => 45,
),
'pseudoconstant' => array(
'optionGroupName' => 'preferred_communication_method',
+ 'optionEditPath' => 'civicrm/admin/options/preferred_communication_method',
),
),
'preferred_language' => array(
'name' => 'preferred_language',
'type' => 2,
'title' => 'Preferred Language',
+ 'description' => 'Which language is preferred for communication. FK to languages in civicrm_option_value.',
'maxlength' => 5,
'size' => 6,
'import' => TRUE,
'export' => TRUE,
'html' => array(
'type' => 'Select',
+ 'maxlength' => 5,
+ 'size' => 6,
),
'pseudoconstant' => array(
'optionGroupName' => 'languages',
'keyColumn' => 'name',
+ 'optionEditPath' => 'civicrm/admin/options/languages',
),
),
'preferred_mail_format' => array(
'name' => 'preferred_mail_format',
'type' => 2,
'title' => 'Preferred Mail Format',
+ 'description' => 'What is the preferred mode of sending an email.',
'maxlength' => 8,
'size' => 8,
'import' => TRUE,
'default' => 'Both',
'html' => array(
'type' => 'Select',
+ 'maxlength' => 8,
+ 'size' => 8,
),
'pseudoconstant' => array(
'callback' => 'CRM_Core_SelectValues::pmf',
'name' => 'hash',
'type' => 2,
'title' => 'Contact Hash',
+ 'description' => 'Key for validating requests related to this contact.',
'maxlength' => 32,
'size' => 20,
'export' => TRUE,
'name' => 'api_key',
'type' => 2,
'title' => 'Api Key',
+ 'description' => 'API Key for validating requests related to this contact.',
'maxlength' => 32,
'size' => 20,
),
'name' => 'first_name',
'type' => 2,
'title' => 'First Name',
+ 'description' => 'First Name.',
'maxlength' => 64,
'size' => 30,
'import' => TRUE,
'export' => TRUE,
'html' => array(
'type' => 'Text',
+ 'maxlength' => 64,
+ 'size' => 30,
),
),
'middle_name' => array(
'name' => 'middle_name',
'type' => 2,
'title' => 'Middle Name',
+ 'description' => 'Middle Name.',
'maxlength' => 64,
- 'size' => 20,
+ 'size' => 30,
'import' => TRUE,
'where' => 'civicrm_contact.middle_name',
'headerPattern' => '/^middle|(m(iddle\\s)?name)$/i',
'export' => TRUE,
'html' => array(
'type' => 'Text',
+ 'maxlength' => 64,
+ 'size' => 30,
),
),
'last_name' => array(
'name' => 'last_name',
'type' => 2,
'title' => 'Last Name',
+ 'description' => 'Last Name.',
'maxlength' => 64,
'size' => 30,
'import' => TRUE,
'export' => TRUE,
'html' => array(
'type' => 'Text',
+ 'maxlength' => 64,
+ 'size' => 30,
),
),
'prefix_id' => array(
'name' => 'prefix_id',
'type' => 1,
'title' => 'Individual Prefix',
+ 'description' => 'Prefix or Title for name (Ms, Mr...). FK to prefix ID',
'import' => TRUE,
'where' => 'civicrm_contact.prefix_id',
'headerPattern' => '/^(prefix|title)/i',
'export' => TRUE,
'html' => array(
'type' => 'Select',
+ 'size' => 6,
+ 'maxlength' => 14,
),
'pseudoconstant' => array(
'optionGroupName' => 'individual_prefix',
+ 'optionEditPath' => 'civicrm/admin/options/individual_prefix',
),
'api.aliases' => array(
'0' => 'individual_prefix',
'name' => 'suffix_id',
'type' => 1,
'title' => 'Individual Suffix',
+ 'description' => 'Suffix for name (Jr, Sr...). FK to suffix ID',
'import' => TRUE,
'where' => 'civicrm_contact.suffix_id',
'headerPattern' => '/^suffix$/i',
'export' => TRUE,
'html' => array(
'type' => 'Select',
+ 'size' => 6,
+ 'maxlength' => 14,
),
'pseudoconstant' => array(
'optionGroupName' => 'individual_suffix',
+ 'optionEditPath' => 'civicrm/admin/options/individual_suffix',
),
'api.aliases' => array(
'0' => 'individual_suffix',
'name' => 'formal_title',
'type' => 2,
'title' => 'Formal Title',
+ 'description' => 'Formal (academic or similar) title in front of name. (Prof., Dr. etc.)',
'maxlength' => 64,
'size' => 30,
'import' => TRUE,
'where' => 'civicrm_contact.formal_title',
'headerPattern' => '/^title/i',
'export' => TRUE,
+ 'html' => array(
+ 'type' => 'Text',
+ 'maxlength' => 64,
+ 'size' => 30,
+ ),
),
'communication_style_id' => array(
'name' => 'communication_style_id',
'type' => 1,
'title' => 'Communication Style',
+ 'description' => 'Communication style (e.g. formal vs. familiar) to use with this contact. FK to communication styles in civicrm_option_value.',
'export' => TRUE,
'where' => 'civicrm_contact.communication_style_id',
+ 'html' => array(
+ 'type' => 'Select',
+ 'size' => 6,
+ 'maxlength' => 14,
+ ),
'pseudoconstant' => array(
'optionGroupName' => 'communication_style',
+ 'optionEditPath' => 'civicrm/admin/options/communication_style',
),
),
'email_greeting_id' => array(
'name' => 'email_greeting_id',
'type' => 1,
'title' => 'Email Greeting ID',
+ 'description' => 'FK to civicrm_option_value.id, that has to be valid registered Email Greeting.',
),
'email_greeting_custom' => array(
'name' => 'email_greeting_custom',
'type' => 2,
'title' => 'Email Greeting Custom',
+ 'description' => 'Custom Email Greeting.',
'maxlength' => 128,
'size' => 45,
'import' => TRUE,
'where' => 'civicrm_contact.email_greeting_custom',
'html' => array(
'type' => 'Text',
+ 'maxlength' => 128,
+ 'size' => 45,
),
),
'email_greeting_display' => array(
'name' => 'email_greeting_display',
'type' => 2,
'title' => 'Email Greeting',
+ 'description' => 'Cache Email Greeting.',
'maxlength' => 255,
'size' => 45,
'html' => array(
'type' => 'Text',
+ 'maxlength' => 255,
+ 'size' => 45,
),
),
'postal_greeting_id' => array(
'name' => 'postal_greeting_id',
'type' => 1,
'title' => 'Postal Greeting ID',
+ 'description' => 'FK to civicrm_option_value.id, that has to be valid registered Postal Greeting.',
'html' => array(
'type' => 'Text',
+ 'size' => 6,
+ 'maxlength' => 14,
),
),
'postal_greeting_custom' => array(
'name' => 'postal_greeting_custom',
'type' => 2,
'title' => 'Postal Greeting Custom',
+ 'description' => 'Custom Postal greeting.',
'maxlength' => 128,
'size' => 45,
'import' => TRUE,
'where' => 'civicrm_contact.postal_greeting_custom',
'html' => array(
'type' => 'Text',
+ 'maxlength' => 128,
+ 'size' => 45,
),
),
'postal_greeting_display' => array(
'name' => 'postal_greeting_display',
'type' => 2,
'title' => 'Postal Greeting',
+ 'description' => 'Cache Postal greeting.',
'maxlength' => 255,
'size' => 45,
'html' => array(
'type' => 'Text',
+ 'maxlength' => 255,
+ 'size' => 45,
),
),
'addressee_id' => array(
'name' => 'addressee_id',
'type' => 1,
'title' => 'Addressee ID',
+ 'description' => 'FK to civicrm_option_value.id, that has to be valid registered Addressee.',
),
'addressee_custom' => array(
'name' => 'addressee_custom',
'type' => 2,
'title' => 'Addressee Custom',
+ 'description' => 'Custom Addressee.',
'maxlength' => 128,
'size' => 45,
'import' => TRUE,
'where' => 'civicrm_contact.addressee_custom',
'html' => array(
'type' => 'Text',
+ 'maxlength' => 128,
+ 'size' => 45,
),
),
'addressee_display' => array(
'name' => 'addressee_display',
'type' => 2,
'title' => 'Addressee',
+ 'description' => 'Cache Addressee.',
'maxlength' => 255,
'size' => 45,
'html' => array(
'type' => 'Text',
+ 'maxlength' => 255,
+ 'size' => 45,
),
),
'job_title' => array(
'name' => 'job_title',
'type' => 2,
'title' => 'Job Title',
+ 'description' => 'Job Title',
'maxlength' => 255,
- 'size' => 20,
+ 'size' => 30,
'import' => TRUE,
'where' => 'civicrm_contact.job_title',
'headerPattern' => '/^job|(j(ob\\s)?title)$/i',
'export' => TRUE,
'html' => array(
'type' => 'Text',
+ 'maxlength' => 255,
+ 'size' => 30,
),
),
'gender_id' => array(
'name' => 'gender_id',
'type' => 1,
'title' => 'Gender',
+ 'description' => 'FK to gender ID',
'import' => TRUE,
'where' => 'civicrm_contact.gender_id',
'headerPattern' => '/^gender$/i',
'export' => TRUE,
'html' => array(
'type' => 'Select',
+ 'size' => 6,
+ 'maxlength' => 14,
),
'pseudoconstant' => array(
'optionGroupName' => 'gender',
+ 'optionEditPath' => 'civicrm/admin/options/gender',
+ ),
+ 'api.aliases' => array(
+ '0' => 'gender',
),
),
'birth_date' => array(
'name' => 'birth_date',
'type' => 4,
'title' => 'Birth Date',
+ 'description' => 'Date of birth',
'import' => TRUE,
'where' => 'civicrm_contact.birth_date',
'headerPattern' => '/^birth|(b(irth\\s)?date)|D(\\W*)O(\\W*)B(\\W*)$/i',
'name' => 'deceased_date',
'type' => 4,
'title' => 'Deceased Date',
+ 'description' => 'Date of deceased',
'import' => TRUE,
'where' => 'civicrm_contact.deceased_date',
'headerPattern' => '/^deceased|(d(eceased\\s)?date)$/i',
'name' => 'household_name',
'type' => 2,
'title' => 'Household Name',
+ 'description' => 'Household Name.',
'maxlength' => 128,
'size' => 30,
'import' => TRUE,
'export' => TRUE,
'html' => array(
'type' => 'Text',
+ 'maxlength' => 128,
+ 'size' => 30,
),
),
'primary_contact_id' => array(
'name' => 'primary_contact_id',
'type' => 1,
'title' => 'Household Primary Contact ID',
+ 'description' => 'Optional FK to Primary Contact for this household.',
'FKClassName' => 'CRM_Contact_DAO_Contact',
'html' => array(
'type' => 'Select',
+ 'size' => 6,
+ 'maxlength' => 14,
),
'FKApiName' => 'Contact',
),
'name' => 'organization_name',
'type' => 2,
'title' => 'Organization Name',
+ 'description' => 'Organization Name.',
'maxlength' => 128,
'size' => 30,
'import' => TRUE,
'export' => TRUE,
'html' => array(
'type' => 'Text',
+ 'maxlength' => 128,
+ 'size' => 30,
),
),
'sic_code' => array(
'name' => 'sic_code',
'type' => 2,
'title' => 'Sic Code',
+ 'description' => 'Standard Industry Classification Code.',
'maxlength' => 8,
'size' => 8,
'import' => TRUE,
'export' => TRUE,
'html' => array(
'type' => 'Text',
+ 'maxlength' => 8,
+ 'size' => 8,
),
),
'user_unique_id' => array(
'name' => 'user_unique_id',
'type' => 2,
'title' => 'Unique ID (OpenID)',
+ 'description' => 'the OpenID (or OpenID-style http://username.domain/) unique identifier for this contact mainly used for logging in to CiviCRM',
'maxlength' => 255,
'size' => 45,
'import' => TRUE,
'rule' => 'url',
'html' => array(
'type' => 'Text',
+ 'maxlength' => 255,
+ 'size' => 45,
),
),
'created_date' => array(
'name' => 'created_date',
'type' => 256,
'title' => 'Created Date',
+ 'description' => 'When was the contact was created.',
'required' => '',
'export' => TRUE,
'where' => 'civicrm_contact.created_date',
'name' => 'modified_date',
'type' => 256,
'title' => 'Modified Date',
+ 'description' => 'When was the contact (or closely related entity) was created or modified or deleted.',
'required' => '',
'export' => TRUE,
'where' => 'civicrm_contact.modified_date',
'name' => 'source',
'type' => 2,
'title' => 'Contact Source',
+ 'description' => 'where contact come from, e.g. import, donate module insert...',
'maxlength' => 255,
'size' => 30,
'import' => TRUE,
'where' => 'civicrm_contact.source',
- 'headerPattern' => '/(S(ource\\s)?o(f\\s)?C(ontact\\s)?Data)$/i',
+ 'headerPattern' => '/(C(ontact\\s)?Source)$/i',
'export' => TRUE,
'html' => array(
'type' => 'Text',
+ 'maxlength' => 255,
+ 'size' => 30,
),
'uniqueName' => 'contact_source',
),
'employer_id' => array(
'name' => 'employer_id',
'type' => 1,
- 'title' => 'Current Employer ID',
+ 'title' => 'Current Employer',
+ 'description' => 'OPTIONAL FK to civicrm_contact record.',
'export' => TRUE,
'where' => 'civicrm_contact.employer_id',
'FKClassName' => 'CRM_Contact_DAO_Contact',
'html' => array(
- 'type' => 'Autocomplete-Select',
+ 'type' => 'EntityRef',
+ 'size' => 6,
+ 'maxlength' => 14,
),
'uniqueName' => 'current_employer_id',
'FKApiName' => 'Contact',
'extends_entity_column_id' => '',
'is_view' => 0,
'is_multiple' => 0,
- 'option_group_id' => '106',
+ 'option_group_id' => '105',
'date_format' => '',
'time_format' => '',
'is_required' => '1',
+ 'table_name' => 'civicrm_value_select_test_g_1',
+ 'column_name' => 'our_special_field_1',
+ 'pseudoconstant' => array(
+ 'optionGroupName' => 'our_special_field_20170124082923',
+ 'optionEditPath' => 'civicrm/admin/options/our_special_field_20170124082923',
+ ),
'name' => 'custom_1',
'title' => 'Our special field',
'type' => 2,
'dupe_check' => array(
'title' => 'Check for Duplicates',
'description' => 'Throw error if contact create matches dedupe rule',
+ 'type' => 16,
'name' => 'dupe_check',
),
),
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
'recur_frequency_unit' => '',
'is_recur_interval' => '',
'is_recur_installments' => '',
+ 'adjust_recur_start_date' => '',
'is_pay_later' => '1',
'pay_later_text' => '',
'pay_later_receipt' => '',
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
'installments' => '12',
'start_date' => '2013-07-29 00:00:00',
'create_date' => '20120130621222105',
- 'modified_date' => '',
+ 'modified_date' => '2012-11-14 16:02:35',
'cancel_date' => '',
'end_date' => '',
'processor_id' => '',
+ 'payment_token_id' => '',
'trxn_id' => '',
'invoice_id' => '',
'contribution_status_id' => '1',
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
'installments' => '12',
'start_date' => '2013-07-29 00:00:00',
'create_date' => '20120130621222105',
+ 'modified_date' => '2012-11-14 16:02:35',
'contribution_status_id' => '1',
'is_test' => 0,
'cycle_day' => '1',
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
'name' => 'A-team domain',
'description' => 'domain of chaos',
'config_backend' => '',
- 'version' => '4.2',
'contact_id' => '6',
'locales' => '',
'locale_custom_strings' => '',
+ 'domain_version' => '4.2',
),
),
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
'0' => array(
'id' => '1',
'name' => 'Default Domain Name',
- 'config_backend' => 'a:82:{s:18:\"fatalErrorTemplate\";s:20:\"CRM/common/fatal.tpl\";s:15:\"civiRelativeURL\";s:13:\"/index.php?q=\";s:11:\"civiVersion\";s:10:\"4.6.alpha7\";s:11:\"empoweredBy\";b:1;s:10:\"userSystem\";O:26:\"CRM_Utils_System_UnitTests\":5:{s:9:\"is_drupal\";b:0;s:9:\"is_joomla\";b:0;s:12:\"is_wordpress\";b:0;s:19:\"supports_UF_Logging\";b:0;s:24:\"supports_form_extensions\";b:0;}s:11:\"initialized\";i:0;s:15:\"DAOFactoryClass\";s:23:\"CRM_Contact_DAO_Factory\";s:17:\"componentRegistry\";O:18:\"CRM_Core_Component\":0:{}s:9:\"inCiviCRM\";b:0;s:18:\"recaptchaPublicKey\";N;s:5:\"debug\";i:0;s:9:\"backtrace\";i:0;s:12:\"resourceBase\";N;s:13:\"extensionsURL\";N;s:12:\"countryLimit\";a:1:{i:0;s:4:\"1228\";}s:27:\"defaultContactStateProvince\";N;s:13:\"provinceLimit\";a:1:{i:0;s:4:\"1228\";}s:21:\"defaultContactCountry\";s:4:\"1228\";s:15:\"defaultCurrency\";s:3:\"USD\";s:10:\"lcMessages\";s:5:\"en_US\";s:18:\"dateformatDatetime\";s:20:\"%B %E%f, %Y %l:%M %P\";s:14:\"dateformatFull\";s:11:\"%B %E%f, %Y\";s:17:\"dateformatPartial\";s:5:\"%B %Y\";s:14:\"dateformatYear\";s:2:\"%Y\";s:14:\"dateformatTime\";s:8:\"%l:%M %P\";s:15:\"timeInputFormat\";i:1;s:15:\"dateInputFormat\";s:8:\"mm/dd/yy\";s:15:\"fiscalYearStart\";a:2:{s:1:\"M\";i:1;s:1:\"d\";i:1;}s:11:\"moneyformat\";s:5:\"%c %a\";s:16:\"moneyvalueformat\";s:3:\"%!i\";s:15:\"currencySymbols\";s:0:\"\";s:21:\"defaultCurrencySymbol\";s:1:\"$\";s:20:\"monetaryDecimalPoint\";s:1:\".\";s:25:\"monetaryThousandSeparator\";s:1:\",\";s:14:\"gettextCodeset\";s:5:\"utf-8\";s:13:\"gettextDomain\";s:7:\"civicrm\";s:27:\"userFrameworkUsersTableName\";s:5:\"users\";s:21:\"userFrameworkFrontend\";b:0;s:20:\"userFrameworkLogging\";b:0;s:17:\"maxImportFileSize\";i:2097152;s:11:\"maxFileSize\";i:2;s:11:\"mapProvider\";N;s:9:\"mapAPIKey\";N;s:11:\"geoProvider\";N;s:9:\"geoAPIKey\";N;s:13:\"geocodeMethod\";s:0:\"\";s:12:\"mapGeoCoding\";i:1;s:7:\"logging\";b:0;s:16:\"enableComponents\";a:6:{i:0;s:14:\"CiviContribute\";i:1;s:10:\"CiviPledge\";i:2;s:10:\"CiviMember\";i:3;s:9:\"CiviEvent\";i:4;s:8:\"CiviMail\";i:5;s:10:\"CiviReport\";}s:18:\"enableComponentIDs\";a:6:{i:0;i:1;i:1;i:6;i:2;i:2;i:3;i:3;i:4;i:4;i:5;i:8;}s:9:\"enableSSL\";b:0;s:17:\"fatalErrorHandler\";N;s:14:\"legacyEncoding\";s:12:\"Windows-1252\";s:14:\"fieldSeparator\";s:1:\",\";s:17:\"maxLocationBlocks\";i:2;s:15:\"captchaFontPath\";s:25:\"/usr/X11R6/lib/X11/fonts/\";s:11:\"captchaFont\";s:17:\"HelveticaBold.ttf\";s:21:\"includeWildCardInName\";i:1;s:18:\"includeEmailInName\";i:1;s:21:\"includeNickNameInName\";i:0;s:22:\"smartGroupCacheTimeout\";i:5;s:22:\"defaultSearchProfileID\";N;s:21:\"dashboardCacheTimeout\";i:1440;s:15:\"doNotResetCache\";i:0;s:24:\"includeAlphabeticalPager\";i:1;s:20:\"includeOrderByClause\";i:1;s:13:\"oldInputStyle\";i:1;s:14:\"formKeyDisable\";b:0;s:21:\"doNotAttachPDFReceipt\";b:0;s:15:\"wkhtmltopdfPath\";b:0;s:23:\"secondDegRelPermissions\";b:0;s:10:\"wpBasePage\";N;s:9:\"groupTree\";b:0;s:11:\"revampPages\";a:0:{}s:13:\"verpSeparator\";s:1:\".\";s:12:\"mailerPeriod\";i:180;s:16:\"mailerSpoolLimit\";i:0;s:16:\"mailerBatchLimit\";i:0;s:13:\"mailerJobSize\";i:0;s:13:\"mailerJobsMax\";i:0;s:16:\"mailThrottleTime\";i:0;s:12:\"customCSSURL\";N;}',
- 'version' => '3',
+ 'version' => '4.6.alpha1',
'contact_id' => '3',
'locale_custom_strings' => 'a:1:{s:5:\"en_US\";a:0:{}}',
'domain_email' => 'my@email.com',
),
'from_email' => 'info@EXAMPLE.ORG',
'from_name' => 'FIXME',
+ 'domain_version' => '4.6.alpha1',
),
'1' => array(
'id' => '2',
'name' => 'Second Domain',
- 'config_backend' => 'a:82:{s:18:\"fatalErrorTemplate\";s:20:\"CRM/common/fatal.tpl\";s:15:\"civiRelativeURL\";s:13:\"/index.php?q=\";s:11:\"civiVersion\";s:10:\"4.6.alpha7\";s:11:\"empoweredBy\";b:1;s:10:\"userSystem\";O:26:\"CRM_Utils_System_UnitTests\":5:{s:9:\"is_drupal\";b:0;s:9:\"is_joomla\";b:0;s:12:\"is_wordpress\";b:0;s:19:\"supports_UF_Logging\";b:0;s:24:\"supports_form_extensions\";b:0;}s:11:\"initialized\";i:0;s:15:\"DAOFactoryClass\";s:23:\"CRM_Contact_DAO_Factory\";s:17:\"componentRegistry\";O:18:\"CRM_Core_Component\":0:{}s:9:\"inCiviCRM\";b:0;s:18:\"recaptchaPublicKey\";N;s:5:\"debug\";i:0;s:9:\"backtrace\";i:0;s:12:\"resourceBase\";N;s:13:\"extensionsURL\";N;s:12:\"countryLimit\";a:1:{i:0;s:4:\"1228\";}s:27:\"defaultContactStateProvince\";N;s:13:\"provinceLimit\";a:1:{i:0;s:4:\"1228\";}s:21:\"defaultContactCountry\";s:4:\"1228\";s:15:\"defaultCurrency\";s:3:\"USD\";s:10:\"lcMessages\";s:5:\"en_US\";s:18:\"dateformatDatetime\";s:20:\"%B %E%f, %Y %l:%M %P\";s:14:\"dateformatFull\";s:11:\"%B %E%f, %Y\";s:17:\"dateformatPartial\";s:5:\"%B %Y\";s:14:\"dateformatYear\";s:2:\"%Y\";s:14:\"dateformatTime\";s:8:\"%l:%M %P\";s:15:\"timeInputFormat\";i:1;s:15:\"dateInputFormat\";s:8:\"mm/dd/yy\";s:15:\"fiscalYearStart\";a:2:{s:1:\"M\";i:1;s:1:\"d\";i:1;}s:11:\"moneyformat\";s:5:\"%c %a\";s:16:\"moneyvalueformat\";s:3:\"%!i\";s:15:\"currencySymbols\";s:0:\"\";s:21:\"defaultCurrencySymbol\";s:1:\"$\";s:20:\"monetaryDecimalPoint\";s:1:\".\";s:25:\"monetaryThousandSeparator\";s:1:\",\";s:14:\"gettextCodeset\";s:5:\"utf-8\";s:13:\"gettextDomain\";s:7:\"civicrm\";s:27:\"userFrameworkUsersTableName\";s:5:\"users\";s:21:\"userFrameworkFrontend\";b:0;s:20:\"userFrameworkLogging\";b:0;s:17:\"maxImportFileSize\";i:2097152;s:11:\"maxFileSize\";i:2;s:11:\"mapProvider\";N;s:9:\"mapAPIKey\";N;s:11:\"geoProvider\";N;s:9:\"geoAPIKey\";N;s:13:\"geocodeMethod\";s:0:\"\";s:12:\"mapGeoCoding\";i:1;s:7:\"logging\";b:0;s:16:\"enableComponents\";a:6:{i:0;s:14:\"CiviContribute\";i:1;s:10:\"CiviPledge\";i:2;s:10:\"CiviMember\";i:3;s:9:\"CiviEvent\";i:4;s:8:\"CiviMail\";i:5;s:10:\"CiviReport\";}s:18:\"enableComponentIDs\";a:6:{i:0;i:1;i:1;i:6;i:2;i:2;i:3;i:3;i:4;i:4;i:5;i:8;}s:9:\"enableSSL\";b:0;s:17:\"fatalErrorHandler\";N;s:14:\"legacyEncoding\";s:12:\"Windows-1252\";s:14:\"fieldSeparator\";s:1:\",\";s:17:\"maxLocationBlocks\";i:2;s:15:\"captchaFontPath\";s:25:\"/usr/X11R6/lib/X11/fonts/\";s:11:\"captchaFont\";s:17:\"HelveticaBold.ttf\";s:21:\"includeWildCardInName\";i:1;s:18:\"includeEmailInName\";i:1;s:21:\"includeNickNameInName\";i:0;s:22:\"smartGroupCacheTimeout\";i:5;s:22:\"defaultSearchProfileID\";N;s:21:\"dashboardCacheTimeout\";i:1440;s:15:\"doNotResetCache\";i:0;s:24:\"includeAlphabeticalPager\";i:1;s:20:\"includeOrderByClause\";i:1;s:13:\"oldInputStyle\";i:1;s:14:\"formKeyDisable\";b:0;s:21:\"doNotAttachPDFReceipt\";b:0;s:15:\"wkhtmltopdfPath\";b:0;s:23:\"secondDegRelPermissions\";b:0;s:10:\"wpBasePage\";N;s:9:\"groupTree\";b:0;s:11:\"revampPages\";a:0:{}s:13:\"verpSeparator\";s:1:\".\";s:12:\"mailerPeriod\";i:180;s:16:\"mailerSpoolLimit\";i:0;s:16:\"mailerBatchLimit\";i:0;s:13:\"mailerJobSize\";i:0;s:13:\"mailerJobsMax\";i:0;s:16:\"mailThrottleTime\";i:0;s:12:\"customCSSURL\";N;}',
'version' => '4.6.alpha1',
'contact_id' => '2',
'domain_email' => '\"Domain Email\" <domainemail2@example.org>',
),
'from_email' => 'info@EXAMPLE.ORG',
'from_name' => 'FIXME',
+ 'domain_version' => '4.6.alpha1',
),
),
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
'is_error' => 0,
'version' => 3,
'count' => 1,
- 'values' => TRUE,
+ 'values' => 1,
);
return $expectedResult;
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
--- /dev/null
+<?php
+/**
+ * Test Generated example demonstrating the EntityBatch.create API.
+ *
+ * @return array
+ * API result array
+ */
+function entity_batch_create_example() {
+ $params = array(
+ 'entity_id' => 1,
+ 'batch_id' => 1,
+ 'entity_table' => 'civicrm_financial_trxn',
+ );
+
+ try{
+ $result = civicrm_api3('EntityBatch', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
+}
+
+/**
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
+ */
+function entity_batch_create_expectedresult() {
+
+ $expectedResult = array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
+ '1' => array(
+ 'id' => '1',
+ 'entity_table' => 'civicrm_financial_trxn',
+ 'entity_id' => '1',
+ 'batch_id' => '1',
+ ),
+ ),
+ );
+
+ return $expectedResult;
+}
+
+/*
+* This example has been generated from the API test suite.
+* The test that created it is called "testCreateEntityBatch"
+* and can be found at:
+* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/EntityBatchTest.php
+*
+* You can see the outcome of the API tests at
+* https://test.civicrm.org/job/CiviCRM-master-git/
+*
+* To Learn about the API read
+* http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
+*
+* Browse the api on your own site with the api explorer
+* http://MYSITE.ORG/path/to/civicrm/api
+*
+* Read more about testing here
+* http://wiki.civicrm.org/confluence/display/CRM/Testing
+*
+* API Standards documentation:
+* http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
+*/
--- /dev/null
+<?php
+/**
+ * Test Generated example demonstrating the EntityBatch.delete API.
+ *
+ * @return array
+ * API result array
+ */
+function entity_batch_delete_example() {
+ $params = array(
+ 'id' => 3,
+ );
+
+ try{
+ $result = civicrm_api3('EntityBatch', 'delete', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
+}
+
+/**
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
+ */
+function entity_batch_delete_expectedresult() {
+
+ $expectedResult = array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'values' => 1,
+ );
+
+ return $expectedResult;
+}
+
+/*
+* This example has been generated from the API test suite.
+* The test that created it is called "testDeleteEntityBatch"
+* and can be found at:
+* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/EntityBatchTest.php
+*
+* You can see the outcome of the API tests at
+* https://test.civicrm.org/job/CiviCRM-master-git/
+*
+* To Learn about the API read
+* http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
+*
+* Browse the api on your own site with the api explorer
+* http://MYSITE.ORG/path/to/civicrm/api
+*
+* Read more about testing here
+* http://wiki.civicrm.org/confluence/display/CRM/Testing
+*
+* API Standards documentation:
+* http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
+*/
--- /dev/null
+<?php
+/**
+ * Test Generated example demonstrating the EntityBatch.get API.
+ *
+ * @return array
+ * API result array
+ */
+function entity_batch_get_example() {
+ $params = array(
+ 'entity_id' => 2,
+ 'batch_id' => 2,
+ 'entity_table' => 'civicrm_financial_trxn',
+ );
+
+ try{
+ $result = civicrm_api3('EntityBatch', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
+}
+
+/**
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
+ */
+function entity_batch_get_expectedresult() {
+
+ $expectedResult = array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 2,
+ 'values' => array(
+ '2' => array(
+ 'id' => '2',
+ 'entity_table' => 'civicrm_financial_trxn',
+ 'entity_id' => '2',
+ 'batch_id' => '2',
+ ),
+ ),
+ );
+
+ return $expectedResult;
+}
+
+/*
+* This example has been generated from the API test suite.
+* The test that created it is called "testGetEntityBatch"
+* and can be found at:
+* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/EntityBatchTest.php
+*
+* You can see the outcome of the API tests at
+* https://test.civicrm.org/job/CiviCRM-master-git/
+*
+* To Learn about the API read
+* http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
+*
+* Browse the api on your own site with the api explorer
+* http://MYSITE.ORG/path/to/civicrm/api
+*
+* Read more about testing here
+* http://wiki.civicrm.org/confluence/display/CRM/Testing
+*
+* API Standards documentation:
+* http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
+*/
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
--- /dev/null
+<?php
+/**
+ * Test Generated example demonstrating the Event.get API.
+ *
+ * Demonstrates get with Contact Reference Custom Field.
+ *
+ * @return array
+ * API result array
+ */
+function event_get_example() {
+ $params = array(
+ 'return.custom_2' => 1,
+ 'custom_2' => 4,
+ );
+
+ try{
+ $result = civicrm_api3('Event', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
+}
+
+/**
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
+ */
+function event_get_expectedresult() {
+
+ $expectedResult = array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 3,
+ 'values' => array(
+ '3' => array(
+ 'id' => '3',
+ 'title' => 'My test event.',
+ 'event_title' => 'My test event.',
+ 'event_description' => '',
+ 'event_type_id' => '1',
+ 'participant_listing_id' => 0,
+ 'is_public' => '1',
+ 'start_date' => '2013-07-29 00:00:00',
+ 'event_start_date' => '2013-07-29 00:00:00',
+ 'event_end_date' => '',
+ 'is_online_registration' => 0,
+ 'is_monetary' => 0,
+ 'is_map' => 0,
+ 'is_active' => '1',
+ 'is_show_location' => '1',
+ 'default_role_id' => '1',
+ 'is_email_confirm' => 0,
+ 'is_pay_later' => 0,
+ 'is_partial_payment' => 0,
+ 'is_multiple_registrations' => 0,
+ 'max_additional_participants' => 0,
+ 'allow_same_participant_emails' => 0,
+ 'allow_selfcancelxfer' => 0,
+ 'selfcancelxfer_time' => 0,
+ 'is_template' => 0,
+ 'created_date' => '2013-07-28 08:49:19',
+ 'is_share' => '1',
+ 'is_confirm_enabled' => '1',
+ 'is_billing_required' => 0,
+ 'custom_1' => 'defaultValue',
+ 'custom_2_id' => '4',
+ 'custom_2' => 'Contact, Test',
+ ),
+ ),
+ );
+
+ return $expectedResult;
+}
+
+/*
+* This example has been generated from the API test suite.
+* The test that created it is called "testEventGetCustomContactRefFieldCRM16036"
+* and can be found at:
+* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/EventTest.php
+*
+* You can see the outcome of the API tests at
+* https://test.civicrm.org/job/CiviCRM-master-git/
+*
+* To Learn about the API read
+* http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
+*
+* Browse the api on your own site with the api explorer
+* http://MYSITE.ORG/path/to/civicrm/api
+*
+* Read more about testing here
+* http://wiki.civicrm.org/confluence/display/CRM/Testing
+*
+* API Standards documentation:
+* http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
+*/
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
'initial_amount_help_text' => '',
'min_initial_amount' => '',
'is_multiple_registrations' => '',
+ 'max_additional_participants' => '',
'allow_same_participant_emails' => '',
'has_waitlist' => '',
'requires_approval' => '',
'expiration_time' => '',
+ 'allow_selfcancelxfer' => '',
+ 'selfcancelxfer_time' => '',
'waitlist_text' => '',
'approval_req_text' => '',
'is_template' => 0,
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
'id' => '1',
'title' => 'Annual CiviCRM meet',
'event_title' => 'Annual CiviCRM meet',
+ 'event_description' => '',
'event_type_id' => '1',
'participant_listing_id' => 0,
'is_public' => '1',
'start_date' => '2013-07-29 00:00:00',
'event_start_date' => '2013-07-29 00:00:00',
+ 'event_end_date' => '',
'is_online_registration' => 0,
'is_monetary' => 0,
'is_map' => 0,
'is_pay_later' => 0,
'is_partial_payment' => 0,
'is_multiple_registrations' => 0,
+ 'max_additional_participants' => 0,
'allow_same_participant_emails' => 0,
+ 'allow_selfcancelxfer' => 0,
+ 'selfcancelxfer_time' => 0,
'is_template' => 0,
'created_date' => '2013-07-28 08:49:19',
'is_share' => '1',
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
'is_pay_later' => 0,
'is_partial_payment' => 0,
'is_multiple_registrations' => 0,
+ 'max_additional_participants' => 0,
'allow_same_participant_emails' => 0,
+ 'allow_selfcancelxfer' => 0,
+ 'selfcancelxfer_time' => 0,
'is_template' => 0,
'created_date' => '2013-07-28 08:49:19',
'is_share' => '1',
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
'id' => '1',
'title' => 'Annual CiviCRM meet',
'event_title' => 'Annual CiviCRM meet',
+ 'event_description' => '',
'event_type_id' => '1',
'participant_listing_id' => 0,
'is_public' => '1',
'start_date' => '2008-10-21 00:00:00',
'event_start_date' => '2008-10-21 00:00:00',
+ 'event_end_date' => '',
'is_online_registration' => 0,
'max_participants' => '1',
'is_monetary' => 0,
'is_pay_later' => 0,
'is_partial_payment' => 0,
'is_multiple_registrations' => 0,
+ 'max_additional_participants' => 0,
'allow_same_participant_emails' => 0,
+ 'allow_selfcancelxfer' => 0,
+ 'selfcancelxfer_time' => 0,
'is_template' => 0,
- 'created_date' => '2015-02-22 23:13:11',
+ 'created_date' => '2017-01-24 08:34:25',
'is_share' => '1',
'is_confirm_enabled' => '1',
'is_billing_required' => 0,
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
'is_error' => 0,
'version' => 3,
'count' => 1,
- 'values' => TRUE,
+ 'values' => 1,
);
return $expectedResult;
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
'description' => 'New Test Group Created',
'is_active' => '1',
'visibility' => 'Public Pages',
- 'where_clause' => ' ( `civicrm_group_contact-4`.group_id IN ( 4 ) AND `civicrm_group_contact-4`.status IN (\"Added\") ) ',
- 'select_tables' => 'a:8:{s:15:\"civicrm_contact\";i:1;s:15:\"civicrm_address\";i:1;s:15:\"civicrm_country\";i:1;s:13:\"civicrm_email\";i:1;s:13:\"civicrm_phone\";i:1;s:10:\"civicrm_im\";i:1;s:19:\"civicrm_worldregion\";i:1;s:25:\"`civicrm_group_contact-4`\";s:165:\" LEFT JOIN civicrm_group_contact `civicrm_group_contact-4` ON ( contact_a.id = `civicrm_group_contact-4`.contact_id AND `civicrm_group_contact-4`.group_id IN ( 4 ) )\";}',
- 'where_tables' => 'a:2:{s:15:\"civicrm_contact\";i:1;s:25:\"`civicrm_group_contact-4`\";s:165:\" LEFT JOIN civicrm_group_contact `civicrm_group_contact-4` ON ( contact_a.id = `civicrm_group_contact-4`.contact_id AND `civicrm_group_contact-4`.group_id IN ( 4 ) )\";}',
+ 'where_clause' => ' ( `civicrm_group_contact-4`.group_id IN ( 4 ) ) ',
+ 'select_tables' => 'a:8:{s:15:\"civicrm_contact\";i:1;s:15:\"civicrm_address\";i:1;s:15:\"civicrm_country\";i:1;s:13:\"civicrm_email\";i:1;s:13:\"civicrm_phone\";i:1;s:10:\"civicrm_im\";i:1;s:19:\"civicrm_worldregion\";i:1;s:25:\"`civicrm_group_contact-4`\";s:165:\" LEFT JOIN civicrm_group_contact `civicrm_group_contact-4` ON (contact_a.id = `civicrm_group_contact-4`.contact_id AND `civicrm_group_contact-4`.status IN (\'Added\'))\";}',
+ 'where_tables' => 'a:2:{s:15:\"civicrm_contact\";i:1;s:25:\"`civicrm_group_contact-4`\";s:165:\" LEFT JOIN civicrm_group_contact `civicrm_group_contact-4` ON (contact_a.id = `civicrm_group_contact-4`.contact_id AND `civicrm_group_contact-4`.status IN (\'Added\'))\";}',
'group_type' => array(
'0' => '1',
'1' => '2',
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
'name' => 'id',
'type' => 1,
'title' => 'Group ID',
+ 'description' => 'Group ID',
'required' => TRUE,
'api.aliases' => array(
'0' => 'group_id',
'name' => 'name',
'type' => 2,
'title' => 'Group Name',
+ 'description' => 'Internal name of Group.',
'maxlength' => 64,
'size' => 30,
),
'name' => 'title',
'type' => 2,
'title' => 'Group Title',
+ 'description' => 'Name of Group.',
'maxlength' => 64,
'size' => 30,
'api.required' => 1,
'name' => 'description',
'type' => 32,
'title' => 'Group Description',
+ 'description' => 'Optional verbose description of the group.',
'rows' => 2,
'cols' => 60,
'html' => array(
'type' => 'TextArea',
+ 'rows' => 2,
+ 'cols' => 60,
),
),
'source' => array(
'name' => 'source',
'type' => 2,
'title' => 'Group Source',
+ 'description' => 'Module or process which created this group.',
'maxlength' => 64,
'size' => 30,
),
'name' => 'saved_search_id',
'type' => 1,
'title' => 'Saved Search ID',
+ 'description' => 'FK to saved search table.',
'FKClassName' => 'CRM_Contact_DAO_SavedSearch',
'FKApiName' => 'SavedSearch',
),
'name' => 'is_active',
'type' => 16,
'title' => 'Group Enabled',
+ 'description' => 'Is this entry active?',
'api.default' => 1,
),
'visibility' => array(
'name' => 'visibility',
'type' => 2,
'title' => 'Group Visibility Setting',
+ 'description' => 'In what context(s) is this field visible.',
'maxlength' => 24,
'size' => 20,
'default' => 'User and User Admin Only',
'html' => array(
'type' => 'Select',
+ 'maxlength' => 24,
+ 'size' => 20,
),
'pseudoconstant' => array(
'callback' => 'CRM_Core_SelectValues::groupVisibility',
'name' => 'where_clause',
'type' => 32,
'title' => 'Group Where Clause',
+ 'description' => 'the sql where clause if a saved search acl',
),
'select_tables' => array(
'name' => 'select_tables',
'type' => 32,
'title' => 'Tables For Select Clause',
+ 'description' => 'the tables to be included in a select data',
),
'where_tables' => array(
'name' => 'where_tables',
'type' => 32,
'title' => 'Tables For Where Clause',
+ 'description' => 'the tables to be included in the count statement',
),
'group_type' => array(
'name' => 'group_type',
'type' => 2,
'title' => 'Group Type',
+ 'description' => 'FK to group type',
'maxlength' => 128,
'size' => 45,
+ 'pseudoconstant' => array(
+ 'optionGroupName' => 'group_type',
+ 'optionEditPath' => 'civicrm/admin/options/group_type',
+ ),
),
'cache_date' => array(
'name' => 'cache_date',
- 'type' => 12,
+ 'type' => 256,
'title' => 'Group Cache Date',
+ 'description' => 'Date when we created the cache for a smart group',
+ 'required' => '',
),
'refresh_date' => array(
'name' => 'refresh_date',
- 'type' => 12,
+ 'type' => 256,
'title' => 'Next Group Refresh Time',
+ 'description' => 'Date and time when we need to refresh the cache next.',
+ 'required' => '',
),
'parents' => array(
'name' => 'parents',
'type' => 32,
'title' => 'Group Parents',
+ 'description' => 'IDs of the parent(s)',
),
'children' => array(
'name' => 'children',
'type' => 32,
'title' => 'Group Children',
+ 'description' => 'IDs of the child(ren)',
),
'is_hidden' => array(
'name' => 'is_hidden',
'type' => 16,
'title' => 'Group is Hidden',
+ 'description' => 'Is this group hidden?',
),
'is_reserved' => array(
'name' => 'is_reserved',
'name' => 'created_id',
'type' => 1,
'title' => 'Group Created By',
+ 'description' => 'FK to contact table.',
'FKClassName' => 'CRM_Contact_DAO_Contact',
'FKApiName' => 'Contact',
),
'name' => 'modified_id',
'type' => 1,
'title' => 'Group Modified By',
+ 'description' => 'FK to contact table.',
'FKClassName' => 'CRM_Contact_DAO_Contact',
'FKApiName' => 'Contact',
),
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
'description' => 'New Test Group Created',
'is_active' => '1',
'visibility' => 'Public Pages',
- 'where_clause' => ' ( `civicrm_group_contact-3`.group_id IN ( 3 ) AND `civicrm_group_contact-3`.status IN (\"Added\") ) ',
- 'select_tables' => 'a:8:{s:15:\"civicrm_contact\";i:1;s:15:\"civicrm_address\";i:1;s:15:\"civicrm_country\";i:1;s:13:\"civicrm_email\";i:1;s:13:\"civicrm_phone\";i:1;s:10:\"civicrm_im\";i:1;s:19:\"civicrm_worldregion\";i:1;s:25:\"`civicrm_group_contact-3`\";s:165:\" LEFT JOIN civicrm_group_contact `civicrm_group_contact-3` ON ( contact_a.id = `civicrm_group_contact-3`.contact_id AND `civicrm_group_contact-3`.group_id IN ( 3 ) )\";}',
- 'where_tables' => 'a:2:{s:15:\"civicrm_contact\";i:1;s:25:\"`civicrm_group_contact-3`\";s:165:\" LEFT JOIN civicrm_group_contact `civicrm_group_contact-3` ON ( contact_a.id = `civicrm_group_contact-3`.contact_id AND `civicrm_group_contact-3`.group_id IN ( 3 ) )\";}',
+ 'where_clause' => ' ( `civicrm_group_contact-3`.group_id IN ( 3 ) ) ',
+ 'select_tables' => 'a:8:{s:15:\"civicrm_contact\";i:1;s:15:\"civicrm_address\";i:1;s:15:\"civicrm_country\";i:1;s:13:\"civicrm_email\";i:1;s:13:\"civicrm_phone\";i:1;s:10:\"civicrm_im\";i:1;s:19:\"civicrm_worldregion\";i:1;s:25:\"`civicrm_group_contact-3`\";s:165:\" LEFT JOIN civicrm_group_contact `civicrm_group_contact-3` ON (contact_a.id = `civicrm_group_contact-3`.contact_id AND `civicrm_group_contact-3`.status IN (\'Added\'))\";}',
+ 'where_tables' => 'a:2:{s:15:\"civicrm_contact\";i:1;s:25:\"`civicrm_group_contact-3`\";s:165:\" LEFT JOIN civicrm_group_contact `civicrm_group_contact-3` ON (contact_a.id = `civicrm_group_contact-3`.contact_id AND `civicrm_group_contact-3`.status IN (\'Added\'))\";}',
'group_type' => array(
'0' => '1',
'1' => '2',
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
'is_error' => 0,
'version' => 3,
'count' => 1,
- 'values' => TRUE,
+ 'values' => 1,
);
return $expectedResult;
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
'participant_count' => '',
'price_field_value_id' => '1',
'financial_type_id' => '',
- 'deductible_amount' => '',
+ 'non_deductible_amount' => '',
'tax_amount' => '',
),
),
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
'line_total' => '100.00',
'price_field_value_id' => '1',
'financial_type_id' => '1',
- 'deductible_amount' => '0.00',
+ 'non_deductible_amount' => '0.00',
+ 'contribution_type_id' => '1',
),
),
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
--- /dev/null
+<?php
+/**
+ * Test Generated example demonstrating the Mailing.clone API.
+ *
+ * @return array
+ * API result array
+ */
+function mailing_clone_example() {
+ $params = array(
+ 'id' => 21,
+ );
+
+ try{
+ $result = civicrm_api3('Mailing', 'clone', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
+}
+
+/**
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
+ */
+function mailing_clone_expectedresult() {
+
+ $expectedResult = array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 22,
+ 'values' => array(
+ '22' => array(
+ 'id' => '22',
+ 'domain_id' => '1',
+ 'header_id' => '1',
+ 'footer_id' => '2',
+ 'reply_id' => '8',
+ 'unsubscribe_id' => '5',
+ 'resubscribe_id' => '6',
+ 'optout_id' => '7',
+ 'name' => 'mailing name',
+ 'mailing_type' => 'standalone',
+ 'from_name' => 'FIXME',
+ 'from_email' => 'info@EXAMPLE.ORG',
+ 'replyto_email' => 'info@EXAMPLE.ORG',
+ 'template_type' => 'traditional',
+ 'template_options' => '',
+ 'subject' => 'Hello {contact.display_name}',
+ 'body_text' => 'This is {contact.display_name}.
+https://civicrm.org
+{domain.address}{action.optOutUrl}',
+ 'body_html' => '<p>This is {contact.display_name}.</p><p><a href=\'https://civicrm.org/\'>CiviCRM.org</a></p><p>{domain.address}{action.optOutUrl}</p>',
+ 'url_tracking' => '1',
+ 'forward_replies' => 0,
+ 'auto_responder' => 0,
+ 'open_tracking' => '1',
+ 'is_completed' => '',
+ 'msg_template_id' => '',
+ 'override_verp' => '1',
+ 'created_id' => '147',
+ 'created_date' => '2013-07-28 08:49:19',
+ 'scheduled_id' => '',
+ 'scheduled_date' => '',
+ 'approver_id' => '',
+ 'approval_date' => '',
+ 'approval_status_id' => '',
+ 'approval_note' => '',
+ 'is_archived' => '',
+ 'visibility' => 'Public Pages',
+ 'campaign_id' => '',
+ 'dedupe_email' => '1',
+ 'sms_provider_id' => '',
+ 'hash' => '',
+ 'location_type_id' => '',
+ 'email_selection_method' => 'automatic',
+ 'language' => '',
+ ),
+ ),
+ );
+
+ return $expectedResult;
+}
+
+/*
+* This example has been generated from the API test suite.
+* The test that created it is called "testClone"
+* and can be found at:
+* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MailingTest.php
+*
+* You can see the outcome of the API tests at
+* https://test.civicrm.org/job/CiviCRM-master-git/
+*
+* To Learn about the API read
+* http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
+*
+* Browse the api on your own site with the api explorer
+* http://MYSITE.ORG/path/to/civicrm/api
+*
+* Read more about testing here
+* http://wiki.civicrm.org/confluence/display/CRM/Testing
+*
+* API Standards documentation:
+* http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
+*/
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
'resubscribe_id' => '6',
'optout_id' => '7',
'name' => 'mailing name',
+ 'mailing_type' => 'standalone',
'from_name' => 'FIXME',
'from_email' => 'info@EXAMPLE.ORG',
'replyto_email' => 'info@EXAMPLE.ORG',
+ 'template_type' => '',
+ 'template_options' => '',
'subject' => 'Hello {contact.display_name}',
'body_text' => 'This is {contact.display_name}.
+https://civińcrm.org
{domain.address}{action.optOutUrl}',
- 'body_html' => '<p>This is {contact.display_name}.</p><p>{domain.address}{action.optOutUrl}</p>',
+ 'body_html' => '<p>This is {contact.display_name}.</p><p><a href=\'https://civińcrm.org/\'>CiviCRM.org</a></p><p>{domain.address}{action.optOutUrl}</p>',
'url_tracking' => '1',
'forward_replies' => '',
'auto_responder' => '',
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
'is_error' => 0,
'version' => 3,
'count' => 1,
- 'values' => TRUE,
+ 'values' => 1,
);
return $expectedResult;
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
--- /dev/null
+<?php
+/**
+ * Test Generated example demonstrating the MailingEventSubscribe.create API.
+ *
+ * @return array
+ * API result array
+ */
+function mailing_event_subscribe_create_example() {
+ $params = array(
+ 'email' => 'test@test.test',
+ 'group_id' => 2,
+ 'contact_id' => 3,
+ 'hash' => 'b15de8b64e2cec34',
+ 'time_stamp' => '20101212121212',
+ );
+
+ try{
+ $result = civicrm_api3('MailingEventSubscribe', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
+}
+
+/**
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
+ */
+function mailing_event_subscribe_create_expectedresult() {
+
+ $expectedResult = array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
+ '1' => array(
+ 'contact_id' => '3',
+ 'subscribe_id' => '1',
+ 'hash' => '67eac7789eaee00',
+ ),
+ ),
+ );
+
+ return $expectedResult;
+}
+
+/*
+* This example has been generated from the API test suite.
+* The test that created it is called "testMailerGroupSubscribeGivenContactId"
+* and can be found at:
+* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MailingGroupTest.php
+*
+* You can see the outcome of the API tests at
+* https://test.civicrm.org/job/CiviCRM-master-git/
+*
+* To Learn about the API read
+* http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
+*
+* Browse the api on your own site with the api explorer
+* http://MYSITE.ORG/path/to/civicrm/api
+*
+* Read more about testing here
+* http://wiki.civicrm.org/confluence/display/CRM/Testing
+*
+* API Standards documentation:
+* http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
+*/
--- /dev/null
+<?php
+/**
+ * Test Generated example demonstrating the Mapping.create API.
+ *
+ * @return array
+ * API result array
+ */
+function mapping_create_example() {
+ $params = array(
+ 'name' => 'Mapping name',
+ 'description' => 'Mapping description',
+ 'mapping_type_id' => 7,
+ );
+
+ try{
+ $result = civicrm_api3('Mapping', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
+}
+
+/**
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
+ */
+function mapping_create_expectedresult() {
+
+ $expectedResult = array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
+ '1' => array(
+ 'id' => '1',
+ 'name' => 'Mapping name',
+ 'description' => 'Mapping description',
+ 'mapping_type_id' => '7',
+ ),
+ ),
+ );
+
+ return $expectedResult;
+}
+
+/*
+* This example has been generated from the API test suite.
+* The test that created it is called "testCreateMapping"
+* and can be found at:
+* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MappingTest.php
+*
+* You can see the outcome of the API tests at
+* https://test.civicrm.org/job/CiviCRM-master-git/
+*
+* To Learn about the API read
+* http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
+*
+* Browse the api on your own site with the api explorer
+* http://MYSITE.ORG/path/to/civicrm/api
+*
+* Read more about testing here
+* http://wiki.civicrm.org/confluence/display/CRM/Testing
+*
+* API Standards documentation:
+* http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
+*/
--- /dev/null
+<?php
+/**
+ * Test Generated example demonstrating the Mapping.delete API.
+ *
+ * @return array
+ * API result array
+ */
+function mapping_delete_example() {
+ $params = array(
+ 'id' => 3,
+ );
+
+ try{
+ $result = civicrm_api3('Mapping', 'delete', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
+}
+
+/**
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
+ */
+function mapping_delete_expectedresult() {
+
+ $expectedResult = array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'values' => 1,
+ );
+
+ return $expectedResult;
+}
+
+/*
+* This example has been generated from the API test suite.
+* The test that created it is called "testDeleteMapping"
+* and can be found at:
+* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MappingTest.php
+*
+* You can see the outcome of the API tests at
+* https://test.civicrm.org/job/CiviCRM-master-git/
+*
+* To Learn about the API read
+* http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
+*
+* Browse the api on your own site with the api explorer
+* http://MYSITE.ORG/path/to/civicrm/api
+*
+* Read more about testing here
+* http://wiki.civicrm.org/confluence/display/CRM/Testing
+*
+* API Standards documentation:
+* http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
+*/
--- /dev/null
+<?php
+/**
+ * Test Generated example demonstrating the Mapping.get API.
+ *
+ * @return array
+ * API result array
+ */
+function mapping_get_example() {
+ $params = array(
+ 'name' => 'Mapping name',
+ 'description' => 'Mapping description',
+ 'mapping_type_id' => 7,
+ );
+
+ try{
+ $result = civicrm_api3('Mapping', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
+}
+
+/**
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
+ */
+function mapping_get_expectedresult() {
+
+ $expectedResult = array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 2,
+ 'values' => array(
+ '2' => array(
+ 'id' => '2',
+ 'name' => 'Mapping name',
+ 'description' => 'Mapping description',
+ 'mapping_type_id' => '7',
+ ),
+ ),
+ );
+
+ return $expectedResult;
+}
+
+/*
+* This example has been generated from the API test suite.
+* The test that created it is called "testGetMapping"
+* and can be found at:
+* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MappingTest.php
+*
+* You can see the outcome of the API tests at
+* https://test.civicrm.org/job/CiviCRM-master-git/
+*
+* To Learn about the API read
+* http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
+*
+* Browse the api on your own site with the api explorer
+* http://MYSITE.ORG/path/to/civicrm/api
+*
+* Read more about testing here
+* http://wiki.civicrm.org/confluence/display/CRM/Testing
+*
+* API Standards documentation:
+* http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
+*/
--- /dev/null
+<?php
+/**
+ * Test Generated example demonstrating the MappingField.create API.
+ *
+ * @return array
+ * API result array
+ */
+function mapping_field_create_example() {
+ $params = array(
+ 'mapping_id' => 1,
+ 'name' => 'last_name',
+ 'contact_type' => 'Individual',
+ 'column_number' => 2,
+ 'grouping' => 1,
+ );
+
+ try{
+ $result = civicrm_api3('MappingField', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
+}
+
+/**
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
+ */
+function mapping_field_create_expectedresult() {
+
+ $expectedResult = array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
+ '1' => array(
+ 'id' => '1',
+ 'mapping_id' => '1',
+ 'name' => 'last_name',
+ 'contact_type' => 'Individual',
+ 'column_number' => '2',
+ 'location_type_id' => '',
+ 'phone_type_id' => '',
+ 'im_provider_id' => '',
+ 'website_type_id' => '',
+ 'relationship_type_id' => '',
+ 'relationship_direction' => '',
+ 'grouping' => '1',
+ 'operator' => '',
+ 'value' => '',
+ ),
+ ),
+ );
+
+ return $expectedResult;
+}
+
+/*
+* This example has been generated from the API test suite.
+* The test that created it is called "testCreateMappingField"
+* and can be found at:
+* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MappingFieldTest.php
+*
+* You can see the outcome of the API tests at
+* https://test.civicrm.org/job/CiviCRM-master-git/
+*
+* To Learn about the API read
+* http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
+*
+* Browse the api on your own site with the api explorer
+* http://MYSITE.ORG/path/to/civicrm/api
+*
+* Read more about testing here
+* http://wiki.civicrm.org/confluence/display/CRM/Testing
+*
+* API Standards documentation:
+* http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
+*/
--- /dev/null
+<?php
+/**
+ * Test Generated example demonstrating the MappingField.delete API.
+ *
+ * @return array
+ * API result array
+ */
+function mapping_field_delete_example() {
+ $params = array(
+ 'id' => 3,
+ );
+
+ try{
+ $result = civicrm_api3('MappingField', 'delete', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
+}
+
+/**
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
+ */
+function mapping_field_delete_expectedresult() {
+
+ $expectedResult = array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'values' => 1,
+ );
+
+ return $expectedResult;
+}
+
+/*
+* This example has been generated from the API test suite.
+* The test that created it is called "testDeleteMappingField"
+* and can be found at:
+* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MappingFieldTest.php
+*
+* You can see the outcome of the API tests at
+* https://test.civicrm.org/job/CiviCRM-master-git/
+*
+* To Learn about the API read
+* http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
+*
+* Browse the api on your own site with the api explorer
+* http://MYSITE.ORG/path/to/civicrm/api
+*
+* Read more about testing here
+* http://wiki.civicrm.org/confluence/display/CRM/Testing
+*
+* API Standards documentation:
+* http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
+*/
--- /dev/null
+<?php
+/**
+ * Test Generated example demonstrating the MappingField.get API.
+ *
+ * @return array
+ * API result array
+ */
+function mapping_field_get_example() {
+ $params = array(
+ 'mapping_id' => 2,
+ 'name' => 'last_name',
+ 'contact_type' => 'Individual',
+ 'column_number' => 2,
+ 'grouping' => 1,
+ );
+
+ try{
+ $result = civicrm_api3('MappingField', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
+}
+
+/**
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
+ */
+function mapping_field_get_expectedresult() {
+
+ $expectedResult = array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 2,
+ 'values' => array(
+ '2' => array(
+ 'id' => '2',
+ 'mapping_id' => '2',
+ 'name' => 'last_name',
+ 'contact_type' => 'Individual',
+ 'column_number' => '2',
+ 'grouping' => '1',
+ ),
+ ),
+ );
+
+ return $expectedResult;
+}
+
+/*
+* This example has been generated from the API test suite.
+* The test that created it is called "testGetMappingField"
+* and can be found at:
+* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MappingFieldTest.php
+*
+* You can see the outcome of the API tests at
+* https://test.civicrm.org/job/CiviCRM-master-git/
+*
+* To Learn about the API read
+* http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
+*
+* Browse the api on your own site with the api explorer
+* http://MYSITE.ORG/path/to/civicrm/api
+*
+* Read more about testing here
+* http://wiki.civicrm.org/confluence/display/CRM/Testing
+*
+* API Standards documentation:
+* http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
+*/
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
function membership_delete_example() {
$params = array(
'id' => 1,
+ 'preserve_contribution' => 1,
);
try{
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
/*
* This example has been generated from the API test suite.
-* The test that created it is called "testMembershipDelete"
+* The test that created it is called "testMembershipDeletePreserveContribution"
* and can be found at:
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MembershipTest.php
*
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
--- /dev/null
+<?php
+/**
+ * Test Generated example demonstrating the Membership.create API.
+ *
+ * @return array
+ * API result array
+ */
+function membership_create_example() {
+ $params = array(
+ 'contact_id' => 94,
+ 'membership_type_id' => 57,
+ 'join_date' => '2009-01-21',
+ 'start_date' => '2009-01-21',
+ 'end_date' => '2009-12-21',
+ 'source' => 'Payment',
+ 'is_override' => 1,
+ 'status_id' => 35,
+ );
+
+ try{
+ $result = civicrm_api3('Membership', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
+}
+
+/**
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
+ */
+function membership_create_expectedresult() {
+
+ $expectedResult = array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
+ '1' => array(
+ 'id' => '1',
+ 'contact_id' => '94',
+ 'membership_type_id' => '57',
+ 'join_date' => '20090121000000',
+ 'start_date' => '2013-07-29 00:00:00',
+ 'end_date' => '2013-08-04 00:00:00',
+ 'source' => 'Payment',
+ 'status_id' => '35',
+ 'is_override' => '1',
+ 'owner_membership_id' => '',
+ 'max_related' => '',
+ 'is_test' => 0,
+ 'is_pay_later' => '',
+ 'contribution_recur_id' => '',
+ 'campaign_id' => '',
+ ),
+ ),
+ );
+
+ return $expectedResult;
+}
+
+/*
+* This example has been generated from the API test suite.
+* The test that created it is called "testSearchWithCustomDataCRM16036"
+* and can be found at:
+* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MembershipTest.php
+*
+* You can see the outcome of the API tests at
+* https://test.civicrm.org/job/CiviCRM-master-git/
+*
+* To Learn about the API read
+* http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
+*
+* Browse the api on your own site with the api explorer
+* http://MYSITE.ORG/path/to/civicrm/api
+*
+* Read more about testing here
+* http://wiki.civicrm.org/confluence/display/CRM/Testing
+*
+* API Standards documentation:
+* http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
+*/
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
'receipt_text_signup' => '',
'receipt_text_renewal' => '',
'auto_renew' => '',
- 'is_active' => '',
+ 'is_active' => '1',
'contribution_type_id' => '1',
),
),
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
'is_error' => 0,
'version' => 3,
'count' => 1,
- 'values' => TRUE,
+ 'values' => 1,
);
return $expectedResult;
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
'is_error' => 0,
'version' => 3,
'count' => 1,
- 'values' => TRUE,
+ 'values' => 1,
);
return $expectedResult;
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
--- /dev/null
+<?php
+/**
+ * Test Generated example demonstrating the OpenID.create API.
+ *
+ * @return array
+ * API result array
+ */
+function open_i_d_create_example() {
+ $params = array(
+ 'contact_id' => 3,
+ 'openid' => 'My OpenID handle',
+ 'location_type_id' => 1,
+ );
+
+ try{
+ $result = civicrm_api3('OpenID', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
+}
+
+/**
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
+ */
+function open_i_d_create_expectedresult() {
+
+ $expectedResult = array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
+ '1' => array(
+ 'id' => '1',
+ 'contact_id' => '3',
+ 'location_type_id' => '1',
+ 'openid' => 'My OpenID handle',
+ 'allowed_to_login' => '',
+ 'is_primary' => '',
+ ),
+ ),
+ );
+
+ return $expectedResult;
+}
+
+/*
+* This example has been generated from the API test suite.
+* The test that created it is called "testCreateOpenID"
+* and can be found at:
+* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/OpenIDTest.php
+*
+* You can see the outcome of the API tests at
+* https://test.civicrm.org/job/CiviCRM-master-git/
+*
+* To Learn about the API read
+* http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
+*
+* Browse the api on your own site with the api explorer
+* http://MYSITE.ORG/path/to/civicrm/api
+*
+* Read more about testing here
+* http://wiki.civicrm.org/confluence/display/CRM/Testing
+*
+* API Standards documentation:
+* http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
+*/
--- /dev/null
+<?php
+/**
+ * Test Generated example demonstrating the OpenID.delete API.
+ *
+ * @return array
+ * API result array
+ */
+function open_i_d_delete_example() {
+ $params = array(
+ 'id' => 3,
+ );
+
+ try{
+ $result = civicrm_api3('OpenID', 'delete', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
+}
+
+/**
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
+ */
+function open_i_d_delete_expectedresult() {
+
+ $expectedResult = array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'values' => 1,
+ );
+
+ return $expectedResult;
+}
+
+/*
+* This example has been generated from the API test suite.
+* The test that created it is called "testDeleteOpenID"
+* and can be found at:
+* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/OpenIDTest.php
+*
+* You can see the outcome of the API tests at
+* https://test.civicrm.org/job/CiviCRM-master-git/
+*
+* To Learn about the API read
+* http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
+*
+* Browse the api on your own site with the api explorer
+* http://MYSITE.ORG/path/to/civicrm/api
+*
+* Read more about testing here
+* http://wiki.civicrm.org/confluence/display/CRM/Testing
+*
+* API Standards documentation:
+* http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
+*/
--- /dev/null
+<?php
+/**
+ * Test Generated example demonstrating the OpenID.get API.
+ *
+ * @return array
+ * API result array
+ */
+function open_i_d_get_example() {
+ $params = array(
+ 'contact_id' => 4,
+ 'openid' => 'My OpenID handle',
+ 'location_type_id' => 1,
+ );
+
+ try{
+ $result = civicrm_api3('OpenID', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
+}
+
+/**
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
+ */
+function open_i_d_get_expectedresult() {
+
+ $expectedResult = array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 2,
+ 'values' => array(
+ '2' => array(
+ 'id' => '2',
+ 'contact_id' => '4',
+ 'location_type_id' => '1',
+ 'openid' => 'My OpenID handle',
+ 'allowed_to_login' => 0,
+ 'is_primary' => 0,
+ ),
+ ),
+ );
+
+ return $expectedResult;
+}
+
+/*
+* This example has been generated from the API test suite.
+* The test that created it is called "testGetOpenID"
+* and can be found at:
+* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/OpenIDTest.php
+*
+* You can see the outcome of the API tests at
+* https://test.civicrm.org/job/CiviCRM-master-git/
+*
+* To Learn about the API read
+* http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
+*
+* Browse the api on your own site with the api explorer
+* http://MYSITE.ORG/path/to/civicrm/api
+*
+* Read more about testing here
+* http://wiki.civicrm.org/confluence/display/CRM/Testing
+*
+* API Standards documentation:
+* http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
+*/
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
'is_error' => 0,
'version' => 3,
'count' => 1,
- 'values' => TRUE,
+ 'values' => 1,
);
return $expectedResult;
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
'option_group_id' => '1',
'label' => 'Phone',
'value' => '1',
+ 'name' => 'Phone',
'filter' => 0,
'weight' => '1',
'is_optgroup' => 0,
'option_group_id' => '1',
'label' => 'Email',
'value' => '2',
+ 'name' => 'Email',
'filter' => 0,
'weight' => '2',
'is_optgroup' => 0,
'option_group_id' => '1',
'label' => 'Postal Mail',
'value' => '3',
+ 'name' => 'Postal Mail',
'filter' => 0,
'weight' => '3',
'is_optgroup' => 0,
'option_group_id' => '1',
'label' => 'SMS',
'value' => '4',
+ 'name' => 'SMS',
'filter' => 0,
'weight' => '4',
'is_optgroup' => 0,
'option_group_id' => '1',
'label' => 'Fax',
'value' => '5',
+ 'name' => 'Fax',
'filter' => 0,
'weight' => '5',
'is_optgroup' => 0,
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
'option_group_id' => '1',
'label' => 'SMS',
'value' => '4',
+ 'name' => 'SMS',
'filter' => 0,
'weight' => '4',
'is_optgroup' => 0,
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
'campaign_id' => '',
'creditnote_id' => 'CN_1',
'tax_amount' => '',
+ 'revenue_recognition_date' => '',
'contribution_type_id' => '1',
),
),
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
'campaign_id' => '',
'creditnote_id' => '',
'tax_amount' => '',
+ 'revenue_recognition_date' => '',
'contribution_type_id' => '1',
),
),
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
'campaign_id' => '',
'creditnote_id' => '',
'tax_amount' => '',
+ 'revenue_recognition_date' => '',
'contribution_type_id' => '1',
),
),
/*
* This example has been generated from the API test suite.
-* The test that created it is called "testAddOrderForPariticipant"
+* The test that created it is called "testAddOrderForParticipant"
* and can be found at:
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/OrderTest.php
*
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
'discount_amount' => '',
'cart_id' => '',
'must_wait' => '',
+ 'transferred_to_contact_id' => '',
),
),
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
'is_pay_later' => 0,
'is_partial_payment' => 0,
'is_multiple_registrations' => 0,
+ 'max_additional_participants' => 0,
'allow_same_participant_emails' => 0,
+ 'allow_selfcancelxfer' => 0,
+ 'selfcancelxfer_time' => 0,
'is_template' => 0,
'created_date' => '2013-07-28 08:49:19',
'is_share' => '1',
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
'currency' => 'NZD',
'financial_type_id' => 1,
);
- $getResult = $this->callAPIAndDocument($this->_entity, 'get', $getParams, __FUNCTION__, __FILE__);
+ $getResult = $this->callAPISuccess($this->_entity, 'get', $getParams);
$this->assertEquals(1, $getResult['count']);
}
'cvv2' => 123,
);
- $this->callAPIAndDocument('contribution_page', 'submit', $submitParams, __FUNCTION__, __FILE__, 'submit contribution page', NULL);
+ $this->callAPISuccess('contribution_page', 'submit', $submitParams);
$contribution = $this->callAPISuccess('contribution', 'getsingle', array('contribution_page_id' => $this->_ids['contribution_page']));
$this->callAPISuccess('membership_payment', 'getsingle', array('contribution_id' => $contribution['id']));
$mut->checkMailLog(array(
'email-Primary' => 'billy-goat@the-new-bridge.net',
);
- $this->callAPIAndDocument('contribution_page', 'submit', $submitParams, __FUNCTION__, __FILE__, 'submit contribution page', NULL);
+ $this->callAPISuccess('contribution_page', 'submit', $submitParams);
$contribution = $this->callAPISuccess('contribution', 'getsingle', array('contribution_page_id' => $this->_ids['contribution_page']));
$this->callAPISuccess('membership_payment', 'getsingle', array('contribution_id' => $contribution['id']));
$mut->checkMailLog(array(
'selectMembership' => $this->_ids['membership_type'],
);
- $this->callAPIAndDocument('contribution_page', 'submit', $submitParams, __FUNCTION__, __FILE__, 'submit contribution page', NULL);
+ $this->callAPISuccess('contribution_page', 'submit', $submitParams);
$contributions = $this->callAPISuccess('contribution', 'get', array('contribution_page_id' => $this->_ids['contribution_page']));
$this->assertCount(2, $contributions['values']);
$lines = $this->callAPISuccess('LineItem', 'get', array('sequential' => 1));
'cvv2' => 123,
);
- $this->callAPIAndDocument('contribution_page', 'submit', $submitParams, __FUNCTION__, __FILE__, 'submit contribution page', NULL);
+ $this->callAPISuccess('contribution_page', 'submit', $submitParams);
$contributions = $this->callAPISuccess('contribution', 'get', array('contribution_page_id' => $this->_ids['contribution_page']));
$this->assertCount(2, $contributions['values']);
$membershipPayment = $this->callAPISuccess('membership_payment', 'getsingle', array());
$params = array(
'contribution_id' => $this->_contribution['id'],
);
- $contribution = $this->callAPIAndDocument('contribution', 'get', $params, __FUNCTION__, __FILE__);
+ $contribution = $this->callAPISuccess('contribution', 'get', $params);
$financialParams['id'] = $this->_financialTypeId;
$default = NULL;
CRM_Financial_BAO_FinancialType::retrieve($financialParams, $default);
'contribution_status_id' => 1,
);
- $contribution = $this->callAPIAndDocument('contribution', 'create', $params, __FUNCTION__, __FILE__);
+ $contribution = $this->callAPISuccess('contribution', 'create', $params);
$this->assertEquals($contribution['values'][$contribution['id']]['contact_id'], $this->_individualId);
$this->assertEquals($contribution['values'][$contribution['id']]['total_amount'], 100.00);
$this->assertEquals($contribution['values'][$contribution['id']]['financial_type_id'], 1);
'contribution_status_id' => 1,
);
- $contribution = $this->callAPIAndDocument('contribution', 'create', $params, __FUNCTION__, __FILE__);
+ $contribution = $this->callAPISuccess('contribution', 'create', $params);
$this->assertEquals($contribution['values'][$contribution['id']]['contact_id'], $this->_individualId);
$this->assertEquals($contribution['values'][$contribution['id']]['total_amount'], 100.00);
$this->assertEquals($contribution['values'][$contribution['id']]['fee_amount'], 50.00);
);
- $contribution = $this->callAPIAndDocument('contribution', 'create', $params, __FUNCTION__, __FILE__);
+ $contribution = $this->callAPISuccess('contribution', 'create', $params);
$this->assertEquals($contribution['values'][$contribution['id']]['contact_id'], $this->_individualId);
$this->assertEquals($contribution['values'][$contribution['id']]['total_amount'], 100.00);
$this->assertEquals($contribution['values'][$contribution['id']]['financial_type_id'], 1);
'contribution_status_id' => 2,
);
- $contribution = $this->callAPIAndDocument('contribution', 'create', $params, __FUNCTION__, __FILE__);
+ $contribution = $this->callAPISuccess('contribution', 'create', $params);
$this->assertEquals($contribution['values'][$contribution['id']]['contact_id'], $this->_individualId);
$this->assertEquals($contribution['values'][$contribution['id']]['total_amount'], 100.00);
$this->assertEquals($contribution['values'][$contribution['id']]['financial_type_id'], 1);
),
);
- $description = "Create Contribution with Nested Line Items.";
- $subfile = "CreateWithNestedLineItems";
- $config = &CRM_Core_Config::singleton();
+ $config = CRM_Core_Config::singleton();
$config->userPermissionClass->permissions = array(
'access CiviCRM',
'access CiviContribute',
'add contributions of type Donation',
'delete contributions of type Donation',
);
- $contribution = $this->callAPIFailure('contribution', 'create', $params, 'Error in call to LineItem_create : You do not have permission to create this line item');
+ $this->callAPIFailure('contribution', 'create', $params, 'Error in call to LineItem_create : You do not have permission to create this line item');
// Check that the entire contribution has rolled back.
$contribution = $this->callAPISuccess('contribution', 'get', array());
CRM_Financial_BAO_FinancialType::$_availableFinancialTypes = NULL;
- $config = &CRM_Core_Config::singleton();
+ $config = CRM_Core_Config::singleton();
$config->userPermissionClass->permissions = array_merge($config->userPermissionClass->permissions, array(
'add contributions of type Member Dues',
'view contributions of type Donation',
'view contributions of type Member Dues',
'delete contributions of type Member Dues',
));
- $contribution = $this->callAPIAndDocument('contribution', 'create', $params, __FUNCTION__, __FILE__, $description, $subfile);
+ $contribution = $this->callAPISuccess('contribution', 'create', $params);
$lineItemParams = array(
'contribution_id' => $contribution['id'],
'check_permissions' => TRUE,
'total_amount' => 200.00,
);
- $config = &CRM_Core_Config::singleton();
+ $config = CRM_Core_Config::singleton();
$config->userPermissionClass->permissions = array(
'access CiviCRM',
'access CiviContribute',
'edit contributions',
'view contributions of type Donation',
);
- $contribution = $this->callAPIFailure('Contribution', 'create', $params);
+ $this->callAPIFailure('Contribution', 'create', $params);
$config->userPermissionClass->permissions[] = 'edit contributions of type Donation';
$contribution = $this->callAPISuccess('Contribution', 'create', $params);
*/
public function testDeleteACLContribution() {
$this->setACL();
- $config = &CRM_Core_Config::singleton();
+ $config = CRM_Core_Config::singleton();
$config->userPermissionClass->permissions = array(
'access CiviCRM',
'access CiviContribute',
'check_permissions' => TRUE,
);
$config->userPermissionClass->permissions[3] = 'delete in CiviContribute';
- $contribution = $this->callAPIFailure('Contribution', 'delete', $params);
+ $this->callAPIFailure('Contribution', 'delete', $params);
$config->userPermissionClass->permissions[] = 'delete contributions of type Donation';
$contribution = $this->callAPISuccess('Contribution', 'delete', $params);