<?php
/**
- * Test Generated example of using activity Create API
- * demonstrates create with Contact Reference Custom Field *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function activity_create_example(){
-$params = array(
- 'source_contact_id' => 1,
- 'activity_type_id' => '49',
- 'subject' => 'test activity type id',
- 'activity_date_time' => '2011-06-02 14:36:13',
- 'status_id' => 2,
- 'priority_id' => 1,
- 'duration' => 120,
- 'location' => 'Pensulvania',
- 'details' => 'a test activity',
- 'custom_2' => '1',
-);
-try{
- $result = civicrm_api3('activity', 'Create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using activity Create API.
+ *
+ * demonstrates create with Contact Reference Custom Field
+ *
+ * @return array
+ * API result array
+ */
+function activity_create_example() {
+ $params = array(
+ 'source_contact_id' => 1,
+ 'activity_type_id' => '51',
+ 'subject' => 'test activity type id',
+ 'activity_date_time' => '2011-06-02 14:36:13',
+ 'status_id' => 2,
+ 'priority_id' => 1,
+ 'duration' => 120,
+ 'location' => 'Pensulvania',
+ 'details' => 'a test activity',
+ 'custom_2' => '1',
+ );
-return $result;
+ try{
+ $result = civicrm_api3('activity', 'Create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function activity_create_expectedresult(){
+function activity_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'source_record_id' => '',
- 'activity_type_id' => '49',
- 'subject' => 'test activity type id',
- 'activity_date_time' => '20110602143613',
- 'duration' => '120',
- 'location' => 'Pensulvania',
- 'phone_id' => '',
- 'phone_number' => '',
- 'details' => 'a test activity',
- 'status_id' => '2',
- 'priority_id' => '1',
- 'parent_id' => '',
- 'is_test' => '',
- 'medium_id' => '',
- 'is_auto' => '',
- 'relationship_id' => '',
- 'is_current_revision' => '',
- 'original_id' => '',
- 'result' => '',
- 'is_deleted' => '',
- 'campaign_id' => '',
- 'engagement_level' => '',
- 'weight' => '',
- ),
+ 'id' => '1',
+ 'source_record_id' => '',
+ 'activity_type_id' => '51',
+ 'subject' => 'test activity type id',
+ 'activity_date_time' => '20110602143613',
+ 'duration' => '120',
+ 'location' => 'Pensulvania',
+ 'phone_id' => '',
+ 'phone_number' => '',
+ 'details' => 'a test activity',
+ 'status_id' => '2',
+ 'priority_id' => '1',
+ 'parent_id' => '',
+ 'is_test' => '',
+ 'medium_id' => '',
+ 'is_auto' => '',
+ 'relationship_id' => '',
+ 'is_current_revision' => '',
+ 'original_id' => '',
+ 'result' => '',
+ 'is_deleted' => '',
+ 'campaign_id' => '',
+ 'engagement_level' => '',
+ 'weight' => '',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testActivityCreateCustomContactRefField and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testActivityCreateCustomContactRefField
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ActivityTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using activity get API
- * Get with Contact Ref Custom Field *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function activity_get_example(){
-$params = array(
- 'return.custom_2' => 1,
- 'id' => 1,
-);
-try{
- $result = civicrm_api3('activity', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using activity get API.
+ *
+ * Get with Contact Ref Custom Field
+ *
+ * @return array
+ * API result array
+ */
+function activity_get_example() {
+ $params = array(
+ 'return.custom_2' => 1,
+ 'id' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('activity', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function activity_get_expectedresult(){
+function activity_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'activity_type_id' => '49',
- 'subject' => 'test activity type id',
- 'activity_date_time' => '2011-06-02 14:36:13',
- 'duration' => '120',
- 'location' => 'Pensulvania',
- 'details' => 'a test activity',
- 'status_id' => '2',
- 'priority_id' => '1',
- 'is_test' => 0,
- 'is_auto' => 0,
- 'is_current_revision' => '1',
- 'is_deleted' => 0,
- 'source_contact_id' => '1',
- 'custom_1' => 'defaultValue',
- 'custom_1_1' => 'defaultValue',
- 'custom_2' => 'Anderson, Anthony',
- 'custom_2_1' => 'Anderson, Anthony',
- 'custom_2_1_id' => '1',
- 'custom_2_id' => '1',
- ),
+ 'id' => '1',
+ 'activity_type_id' => '51',
+ 'subject' => 'test activity type id',
+ 'activity_date_time' => '2011-06-02 14:36:13',
+ 'duration' => '120',
+ 'location' => 'Pensulvania',
+ 'details' => 'a test activity',
+ 'status_id' => '2',
+ 'priority_id' => '1',
+ 'is_test' => 0,
+ 'is_auto' => 0,
+ 'is_current_revision' => '1',
+ 'is_deleted' => 0,
+ 'source_contact_id' => '1',
+ 'custom_1' => 'defaultValue',
+ 'custom_1_1' => 'defaultValue',
+ 'custom_2' => 'Anderson, Anthony',
+ 'custom_2_1' => 'Anderson, Anthony',
+ 'custom_2_1_id' => '1',
+ 'custom_2_id' => '1',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testActivityCreateCustomContactRefField and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testActivityCreateCustomContactRefField
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ActivityTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using activity create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function activity_create_example(){
-$params = array(
- 'source_contact_id' => 1,
- 'activity_type_id' => '49',
- 'subject' => 'test activity type id',
- 'activity_date_time' => '2011-06-02 14:36:13',
- 'status_id' => 2,
- 'priority_id' => 1,
- 'duration' => 120,
- 'location' => 'Pensulvania',
- 'details' => 'a test activity',
- 'custom_1' => 'custom string',
-);
-try{
- $result = civicrm_api3('activity', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using activity create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function activity_create_example() {
+ $params = array(
+ 'source_contact_id' => 1,
+ 'activity_type_id' => '51',
+ 'subject' => 'test activity type id',
+ 'activity_date_time' => '2011-06-02 14:36:13',
+ 'status_id' => 2,
+ 'priority_id' => 1,
+ 'duration' => 120,
+ 'location' => 'Pensulvania',
+ 'details' => 'a test activity',
+ 'custom_1' => 'custom string',
+ );
-return $result;
+ try{
+ $result = civicrm_api3('activity', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function activity_create_expectedresult(){
+function activity_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'source_record_id' => '',
- 'activity_type_id' => '49',
- 'subject' => 'test activity type id',
- 'activity_date_time' => '20110602143613',
- 'duration' => '120',
- 'location' => 'Pensulvania',
- 'phone_id' => '',
- 'phone_number' => '',
- 'details' => 'a test activity',
- 'status_id' => '2',
- 'priority_id' => '1',
- 'parent_id' => '',
- 'is_test' => '',
- 'medium_id' => '',
- 'is_auto' => '',
- 'relationship_id' => '',
- 'is_current_revision' => '',
- 'original_id' => '',
- 'result' => '',
- 'is_deleted' => '',
- 'campaign_id' => '',
- 'engagement_level' => '',
- 'weight' => '',
- ),
+ 'id' => '1',
+ 'source_record_id' => '',
+ 'activity_type_id' => '51',
+ 'subject' => 'test activity type id',
+ 'activity_date_time' => '20110602143613',
+ 'duration' => '120',
+ 'location' => 'Pensulvania',
+ 'phone_id' => '',
+ 'phone_number' => '',
+ 'details' => 'a test activity',
+ 'status_id' => '2',
+ 'priority_id' => '1',
+ 'parent_id' => '',
+ 'is_test' => '',
+ 'medium_id' => '',
+ 'is_auto' => '',
+ 'relationship_id' => '',
+ 'is_current_revision' => '',
+ 'original_id' => '',
+ 'result' => '',
+ 'is_deleted' => '',
+ 'campaign_id' => '',
+ 'engagement_level' => '',
+ 'weight' => '',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testActivityCreateCustom and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testActivityCreateCustom
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ActivityTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using activity get API
- * demonstrates _high filter (at time of writing doesn't work if contact_id is set *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function activity_get_example(){
-$params = array(
- 'source_contact_id' => 1,
- 'filter.activity_date_time_high' => '20120101000000',
- 'sequential' => 1,
-);
-try{
- $result = civicrm_api3('activity', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using activity get API.
+ *
+ * demonstrates _high filter (at time of writing doesn't work if contact_id is set
+ *
+ * @return array
+ * API result array
+ */
+function activity_get_example() {
+ $params = array(
+ 'source_contact_id' => 1,
+ 'filter.activity_date_time_high' => '20120101000000',
+ 'sequential' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('activity', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function activity_get_expectedresult(){
+function activity_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'0' => array(
- 'id' => '1',
- 'activity_type_id' => '49',
- 'subject' => 'Make-it-Happen Meeting',
- 'activity_date_time' => '2011-01-01 00:00:00',
- 'duration' => '120',
- 'location' => 'Pensulvania',
- 'details' => 'a test activity',
- 'status_id' => '1',
- 'priority_id' => '1',
- 'is_test' => 0,
- 'is_auto' => 0,
- 'is_current_revision' => '1',
- 'is_deleted' => 0,
- 'source_contact_id' => '1',
- ),
+ 'id' => '1',
+ 'activity_type_id' => '51',
+ 'subject' => 'Make-it-Happen Meeting',
+ 'activity_date_time' => '2011-01-01 00:00:00',
+ 'duration' => '120',
+ 'location' => 'Pensulvania',
+ 'details' => 'a test activity',
+ 'status_id' => '1',
+ 'priority_id' => '1',
+ 'is_test' => 0,
+ 'is_auto' => 0,
+ 'is_current_revision' => '1',
+ 'is_deleted' => 0,
+ 'source_contact_id' => '1',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetFilterMaxDate and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetFilterMaxDate
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ActivityTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using activity get API
- * demonstrates _low filter (at time of writing doesn't work if contact_id is set *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function activity_get_example(){
-$params = array(
- 'filter.activity_date_time_low' => '20120101000000',
- 'sequential' => 1,
-);
-try{
- $result = civicrm_api3('activity', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using activity get API.
+ *
+ * demonstrates _low filter (at time of writing doesn't work if contact_id is set
+ *
+ * @return array
+ * API result array
+ */
+function activity_get_example() {
+ $params = array(
+ 'filter.activity_date_time_low' => '20120101000000',
+ 'sequential' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('activity', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function activity_get_expectedresult(){
+function activity_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 2,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 2,
+ 'values' => array(
'0' => array(
- 'id' => '2',
- 'activity_type_id' => '49',
- 'subject' => 'Make-it-Happen Meeting',
- 'activity_date_time' => '2012-02-16 00:00:00',
- 'duration' => '120',
- 'location' => 'Pensulvania',
- 'details' => 'a test activity',
- 'status_id' => '1',
- 'priority_id' => '1',
- 'is_test' => 0,
- 'is_auto' => 0,
- 'is_current_revision' => '1',
- 'is_deleted' => 0,
- 'source_contact_id' => '1',
- ),
+ 'id' => '2',
+ 'activity_type_id' => '51',
+ 'subject' => 'Make-it-Happen Meeting',
+ 'activity_date_time' => '2012-02-16 00:00:00',
+ 'duration' => '120',
+ 'location' => 'Pensulvania',
+ 'details' => 'a test activity',
+ 'status_id' => '1',
+ 'priority_id' => '1',
+ 'is_test' => 0,
+ 'is_auto' => 0,
+ 'is_current_revision' => '1',
+ 'is_deleted' => 0,
+ 'source_contact_id' => '1',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetFilterMaxDate and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetFilterMaxDate
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ActivityTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using activity delete API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function activity_delete_example(){
-$params = array(
- 'id' => 1,
-);
-try{
- $result = civicrm_api3('activity', 'delete', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using activity delete API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function activity_delete_example() {
+ $params = array(
+ 'id' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('activity', 'delete', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function activity_delete_expectedresult(){
+function activity_delete_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'values' => 1,
-);
+ '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
-*
-* testDeleteActivity and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testDeleteActivity
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ActivityTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using activity get API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function activity_get_example(){
-$params = array(
- 'contact_id' => 1,
- 'activity_type_id' => '49',
- 'sequential' => 1,
- 'return.custom_1' => 1,
-);
-try{
- $result = civicrm_api3('activity', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using activity get API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function activity_get_example() {
+ $params = array(
+ 'contact_id' => 1,
+ 'activity_type_id' => '51',
+ 'sequential' => 1,
+ 'return.custom_1' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('activity', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function activity_get_expectedresult(){
+function activity_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'0' => array(
- 'source_contact_id' => '1',
- 'id' => '1',
- 'activity_type_id' => '49',
- 'subject' => 'test activity type id',
- 'location' => 'Pensulvania',
- 'activity_date_time' => '2011-06-02 14:36:13',
- 'details' => 'a test activity',
- 'status_id' => '2',
- 'activity_name' => 'Test activity type',
- 'status' => 'Completed',
- 'custom_1' => 'custom string',
- 'custom_1_1' => 'custom string',
- ),
+ 'source_contact_id' => '1',
+ 'id' => '1',
+ 'activity_type_id' => '51',
+ 'subject' => 'test activity type id',
+ 'location' => 'Pensulvania',
+ 'activity_date_time' => '2011-06-02 14:36:13',
+ 'details' => 'a test activity',
+ 'status_id' => '2',
+ 'activity_name' => 'Test activity type',
+ 'status' => 'Completed',
+ 'custom_1' => 'custom string',
+ 'custom_1_1' => 'custom string',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testActivityGetContact_idCustom and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testActivityGetContact_idCustom
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ActivityTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using activity API
- * Example demonstrates setting & retrieving the target & source *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function activity__example(){
-$params = array(
- 'source_contact_id' => 1,
- 'subject' => 'Make-it-Happen Meeting',
- 'activity_date_time' => '20110316',
- 'duration' => 120,
- 'location' => 'Pensulvania',
- 'details' => 'a test activity',
- 'status_id' => 1,
- 'activity_type_id' => 1,
- 'priority_id' => 1,
- 'target_contact_id' => 1,
- 'assignee_contact_id' => 1,
-);
-try{
- $result = civicrm_api3('activity', '', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using activity API.
+ *
+ * Example demonstrates setting & retrieving the target & source
+ *
+ * @return array
+ * API result array
+ */
+function activity__example() {
+ $params = array(
+ 'source_contact_id' => 1,
+ 'subject' => 'Make-it-Happen Meeting',
+ 'activity_date_time' => '20110316',
+ 'duration' => 120,
+ 'location' => 'Pensulvania',
+ 'details' => 'a test activity',
+ 'status_id' => 1,
+ 'activity_type_id' => 1,
+ 'priority_id' => 1,
+ 'target_contact_id' => 1,
+ 'assignee_contact_id' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('activity', '', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function activity__expectedresult(){
+function activity__expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'source_record_id' => '',
- 'activity_type_id' => '1',
- 'subject' => 'Make-it-Happen Meeting',
- 'activity_date_time' => '20110316000000',
- 'duration' => '120',
- 'location' => 'Pensulvania',
- 'phone_id' => '',
- 'phone_number' => '',
- 'details' => 'a test activity',
- 'status_id' => '1',
- 'priority_id' => '1',
- 'parent_id' => '',
- 'is_test' => '',
- 'medium_id' => '',
- 'is_auto' => '',
- 'relationship_id' => '',
- 'is_current_revision' => '',
- 'original_id' => '',
- 'result' => '',
- 'is_deleted' => '',
- 'campaign_id' => '',
- 'engagement_level' => '',
- 'weight' => '',
- ),
+ 'id' => '1',
+ 'source_record_id' => '',
+ 'activity_type_id' => '1',
+ 'subject' => 'Make-it-Happen Meeting',
+ 'activity_date_time' => '20110316000000',
+ 'duration' => '120',
+ 'location' => 'Pensulvania',
+ 'phone_id' => '',
+ 'phone_number' => '',
+ 'details' => 'a test activity',
+ 'status_id' => '1',
+ 'priority_id' => '1',
+ 'parent_id' => '',
+ 'is_test' => '',
+ 'medium_id' => '',
+ 'is_auto' => '',
+ 'relationship_id' => '',
+ 'is_current_revision' => '',
+ 'original_id' => '',
+ 'result' => '',
+ 'is_deleted' => '',
+ 'campaign_id' => '',
+ 'engagement_level' => '',
+ 'weight' => '',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testActivityReturnTargetAssignee and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testActivityReturnTargetAssignee
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ActivityTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using activity getfields API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function activity_getfields_example(){
-$params = array(
- 'action' => 'create',
-);
-try{
- $result = civicrm_api3('activity', 'getfields', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using activity getfields API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function activity_getfields_example() {
+ $params = array(
+ 'action' => 'create',
+ );
+
+ try{
+ $result = civicrm_api3('activity', 'getfields', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
-return $result;
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function activity_getfields_expectedresult(){
+function activity_getfields_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 27,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 27,
+ 'values' => array(
'source_record_id' => array(
- 'name' => 'source_record_id',
- 'type' => 1,
- 'title' => 'Source Record',
- ),
+ 'name' => 'source_record_id',
+ 'type' => 1,
+ 'title' => 'Source Record',
+ ),
'activity_type_id' => array(
- 'name' => 'activity_type_id',
- 'type' => 1,
- 'title' => 'Activity Type',
- 'required' => true,
- 'import' => true,
- 'where' => 'civicrm_activity.activity_type_id',
- 'headerPattern' => '/(activity.)?type(.id$)/i',
- 'default' => '1',
- 'html' => array(
- 'type' => 'Select',
- ),
- 'pseudoconstant' => array(
- 'optionGroupName' => 'activity_type',
- ),
+ 'name' => 'activity_type_id',
+ 'type' => 1,
+ 'title' => 'Activity Type',
+ 'required' => TRUE,
+ 'import' => TRUE,
+ 'where' => 'civicrm_activity.activity_type_id',
+ 'headerPattern' => '/(activity.)?type(.id$)/i',
+ 'default' => '1',
+ 'html' => array(
+ 'type' => 'Select',
),
+ 'pseudoconstant' => array(
+ 'optionGroupName' => 'activity_type',
+ ),
+ ),
'activity_date_time' => array(
- 'name' => 'activity_date_time',
- 'type' => 12,
- 'title' => 'Activity Date',
- 'import' => true,
- 'where' => 'civicrm_activity.activity_date_time',
- 'headerPattern' => '/(activity.)?date(.time$)?/i',
- 'export' => true,
- 'html' => array(
- 'type' => 'Select Date',
- ),
+ 'name' => 'activity_date_time',
+ 'type' => 12,
+ 'title' => 'Activity Date',
+ 'import' => TRUE,
+ 'where' => 'civicrm_activity.activity_date_time',
+ 'headerPattern' => '/(activity.)?date(.time$)?/i',
+ 'export' => TRUE,
+ 'html' => array(
+ 'type' => 'Select Date',
),
+ ),
'phone_id' => array(
- 'name' => 'phone_id',
- 'type' => 1,
- 'title' => 'Phone (called) ID',
- 'FKClassName' => 'CRM_Core_DAO_Phone',
- 'html' => array(
- 'type' => 'Autocomplete-Select',
- ),
+ 'name' => 'phone_id',
+ 'type' => 1,
+ 'title' => 'Phone (called) ID',
+ 'FKClassName' => 'CRM_Core_DAO_Phone',
+ 'html' => array(
+ 'type' => 'Autocomplete-Select',
),
+ 'FKApiName' => 'Phone',
+ ),
'phone_number' => array(
- 'name' => 'phone_number',
- 'type' => 2,
- 'title' => 'Phone (called) Number',
- 'maxlength' => 64,
- 'size' => 30,
- 'html' => array(
- 'type' => 'Text',
- ),
+ 'name' => 'phone_number',
+ 'type' => 2,
+ 'title' => 'Phone (called) Number',
+ 'maxlength' => 64,
+ 'size' => 30,
+ 'html' => array(
+ 'type' => 'Text',
),
+ ),
'priority_id' => array(
- 'name' => 'priority_id',
- 'type' => 1,
- 'title' => 'Priority',
- 'html' => array(
- 'type' => 'Select',
- ),
- 'pseudoconstant' => array(
- 'optionGroupName' => 'priority',
- ),
+ 'name' => 'priority_id',
+ 'type' => 1,
+ 'title' => 'Priority',
+ 'html' => array(
+ 'type' => 'Select',
),
- 'parent_id' => array(
- 'name' => 'parent_id',
- 'type' => 1,
- 'title' => 'Parent Activity Id',
- 'FKClassName' => 'CRM_Activity_DAO_Activity',
+ 'pseudoconstant' => array(
+ 'optionGroupName' => 'priority',
),
+ ),
+ 'parent_id' => array(
+ 'name' => 'parent_id',
+ 'type' => 1,
+ 'title' => 'Parent Activity Id',
+ 'FKClassName' => 'CRM_Activity_DAO_Activity',
+ 'FKApiName' => 'Activity',
+ ),
'is_auto' => array(
- 'name' => 'is_auto',
- 'type' => 16,
- 'title' => 'Auto',
- ),
+ 'name' => 'is_auto',
+ 'type' => 16,
+ 'title' => 'Auto',
+ ),
'relationship_id' => array(
- 'name' => 'relationship_id',
- 'type' => 1,
- 'title' => 'Relationship Id',
- 'default' => 'NULL',
- 'FKClassName' => 'CRM_Contact_DAO_Relationship',
- ),
+ 'name' => 'relationship_id',
+ 'type' => 1,
+ 'title' => 'Relationship Id',
+ 'default' => 'NULL',
+ 'FKClassName' => 'CRM_Contact_DAO_Relationship',
+ 'FKApiName' => 'Relationship',
+ ),
'is_current_revision' => array(
- 'name' => 'is_current_revision',
- 'type' => 16,
- 'title' => 'Is this activity a current revision in versioning chain?',
- 'import' => true,
- 'where' => 'civicrm_activity.is_current_revision',
- 'headerPattern' => '/(is.)?(current.)?(revision|version(ing)?)/i',
- 'export' => true,
- 'default' => '1',
- 'html' => array(
- 'type' => 'CheckBox',
- ),
+ 'name' => 'is_current_revision',
+ 'type' => 16,
+ 'title' => 'Is this activity a current revision in versioning chain?',
+ 'import' => TRUE,
+ 'where' => 'civicrm_activity.is_current_revision',
+ 'headerPattern' => '/(is.)?(current.)?(revision|version(ing)?)/i',
+ 'export' => TRUE,
+ 'default' => '1',
+ 'html' => array(
+ 'type' => 'CheckBox',
),
+ ),
'original_id' => array(
- 'name' => 'original_id',
- 'type' => 1,
- 'title' => 'Original Activity ID ',
- 'FKClassName' => 'CRM_Activity_DAO_Activity',
- ),
+ 'name' => 'original_id',
+ 'type' => 1,
+ 'title' => 'Original Activity ID ',
+ 'FKClassName' => 'CRM_Activity_DAO_Activity',
+ 'FKApiName' => 'Activity',
+ ),
'weight' => array(
- 'name' => 'weight',
- 'type' => 1,
- 'title' => 'Weight',
- 'html' => array(
- 'type' => 'Text',
- ),
+ 'name' => 'weight',
+ 'type' => 1,
+ 'title' => 'Weight',
+ 'html' => array(
+ 'type' => 'Text',
),
+ ),
'id' => array(
- 'name' => 'id',
- 'type' => 1,
- 'title' => 'Activity ID',
- 'required' => true,
- 'import' => true,
- 'where' => 'civicrm_activity.id',
- 'export' => true,
- 'uniqueName' => 'activity_id',
- 'api.aliases' => array(
- '0' => 'activity_id',
- ),
+ 'name' => 'id',
+ 'type' => 1,
+ 'title' => 'Activity ID',
+ 'required' => TRUE,
+ 'import' => TRUE,
+ 'where' => 'civicrm_activity.id',
+ 'export' => TRUE,
+ 'uniqueName' => 'activity_id',
+ 'api.aliases' => array(
+ '0' => 'activity_id',
),
+ ),
'subject' => array(
- 'name' => 'subject',
- 'type' => 2,
- 'title' => 'Subject',
- 'maxlength' => 255,
- 'size' => 45,
- 'import' => true,
- 'where' => 'civicrm_activity.subject',
- 'headerPattern' => '/(activity.)?subject/i',
- 'export' => true,
- 'html' => array(
- 'type' => 'Text',
- ),
- 'uniqueName' => 'activity_subject',
+ 'name' => 'subject',
+ 'type' => 2,
+ 'title' => 'Subject',
+ 'maxlength' => 255,
+ 'size' => 45,
+ 'import' => TRUE,
+ 'where' => 'civicrm_activity.subject',
+ 'headerPattern' => '/(activity.)?subject/i',
+ 'export' => TRUE,
+ 'html' => array(
+ 'type' => 'Text',
),
+ 'uniqueName' => 'activity_subject',
+ ),
'duration' => array(
- 'name' => 'duration',
- 'type' => 1,
- 'title' => 'Duration',
- 'import' => true,
- 'where' => 'civicrm_activity.duration',
- 'headerPattern' => '/(activity.)?duration(s)?$/i',
- 'export' => true,
- 'html' => array(
- 'type' => 'Text',
- ),
- 'uniqueName' => 'activity_duration',
+ 'name' => 'duration',
+ 'type' => 1,
+ 'title' => 'Duration',
+ 'import' => TRUE,
+ 'where' => 'civicrm_activity.duration',
+ 'headerPattern' => '/(activity.)?duration(s)?$/i',
+ 'export' => TRUE,
+ 'html' => array(
+ 'type' => 'Text',
),
+ 'uniqueName' => 'activity_duration',
+ ),
'location' => array(
- 'name' => 'location',
- 'type' => 2,
- 'title' => 'Location',
- 'maxlength' => 255,
- 'size' => 45,
- 'import' => true,
- 'where' => 'civicrm_activity.location',
- 'headerPattern' => '/(activity.)?location$/i',
- 'export' => true,
- 'html' => array(
- 'type' => 'Text',
- ),
- 'uniqueName' => 'activity_location',
+ 'name' => 'location',
+ 'type' => 2,
+ 'title' => 'Location',
+ 'maxlength' => 255,
+ 'size' => 45,
+ 'import' => TRUE,
+ 'where' => 'civicrm_activity.location',
+ 'headerPattern' => '/(activity.)?location$/i',
+ 'export' => TRUE,
+ 'html' => array(
+ 'type' => 'Text',
),
+ 'uniqueName' => 'activity_location',
+ ),
'details' => array(
- 'name' => 'details',
- 'type' => 32,
- 'title' => 'Details',
- 'rows' => 8,
- 'cols' => 60,
- 'import' => true,
- 'where' => 'civicrm_activity.details',
- 'headerPattern' => '/(activity.)?detail(s)?$/i',
- 'export' => true,
- 'html' => array(
- 'type' => 'RichTextEditor',
- ),
- 'uniqueName' => 'activity_details',
+ 'name' => 'details',
+ 'type' => 32,
+ 'title' => 'Details',
+ 'rows' => 8,
+ 'cols' => 60,
+ 'import' => TRUE,
+ 'where' => 'civicrm_activity.details',
+ 'headerPattern' => '/(activity.)?detail(s)?$/i',
+ 'export' => TRUE,
+ 'html' => array(
+ 'type' => 'RichTextEditor',
),
+ 'uniqueName' => 'activity_details',
+ ),
'status_id' => array(
- 'name' => 'status_id',
- 'type' => 1,
- 'title' => 'Activity Status',
- 'import' => true,
- 'where' => 'civicrm_activity.status_id',
- 'headerPattern' => '/(activity.)?status(.label$)?/i',
- 'html' => array(
- 'type' => 'Select',
- ),
- 'pseudoconstant' => array(
- 'optionGroupName' => 'activity_status',
- ),
- 'uniqueName' => 'activity_status_id',
- 'api.aliases' => array(
- '0' => 'activity_status',
- ),
+ 'name' => 'status_id',
+ 'type' => 1,
+ 'title' => 'Activity Status',
+ 'import' => TRUE,
+ 'where' => 'civicrm_activity.status_id',
+ 'headerPattern' => '/(activity.)?status(.label$)?/i',
+ 'html' => array(
+ 'type' => 'Select',
),
+ 'pseudoconstant' => array(
+ 'optionGroupName' => 'activity_status',
+ ),
+ 'uniqueName' => 'activity_status_id',
+ 'api.aliases' => array(
+ '0' => 'activity_status',
+ ),
+ ),
'is_test' => array(
- 'name' => 'is_test',
- 'type' => 16,
- 'title' => 'Test',
- 'import' => true,
- 'where' => 'civicrm_activity.is_test',
- 'headerPattern' => '/(is.)?test(.activity)?/i',
- 'export' => true,
- 'html' => array(
- 'type' => 'Select',
- ),
- 'uniqueName' => 'activity_is_test',
+ 'name' => 'is_test',
+ 'type' => 16,
+ 'title' => 'Test',
+ 'import' => TRUE,
+ 'where' => 'civicrm_activity.is_test',
+ 'headerPattern' => '/(is.)?test(.activity)?/i',
+ 'export' => TRUE,
+ 'html' => array(
+ 'type' => 'Select',
),
+ 'uniqueName' => 'activity_is_test',
+ ),
'medium_id' => array(
- 'name' => 'medium_id',
- 'type' => 1,
- 'title' => 'Activity Medium',
- 'default' => 'NULL',
- 'html' => array(
- 'type' => 'Select',
- ),
- 'pseudoconstant' => array(
- 'optionGroupName' => 'encounter_medium',
- ),
- 'uniqueName' => 'activity_medium_id',
+ 'name' => 'medium_id',
+ 'type' => 1,
+ 'title' => 'Activity Medium',
+ 'default' => 'NULL',
+ 'html' => array(
+ 'type' => 'Select',
+ ),
+ 'pseudoconstant' => array(
+ 'optionGroupName' => 'encounter_medium',
),
+ 'uniqueName' => 'activity_medium_id',
+ ),
'result' => array(
- 'name' => 'result',
- 'type' => 2,
- 'title' => 'Result',
- 'maxlength' => 255,
- 'size' => 45,
- 'html' => array(
- 'type' => 'Text',
- ),
- 'uniqueName' => 'activity_result',
+ 'name' => 'result',
+ 'type' => 2,
+ 'title' => 'Result',
+ 'maxlength' => 255,
+ 'size' => 45,
+ 'html' => array(
+ 'type' => 'Text',
),
+ 'uniqueName' => 'activity_result',
+ ),
'is_deleted' => array(
- 'name' => 'is_deleted',
- 'type' => 16,
- 'title' => 'Activity is in the Trash',
- 'import' => true,
- 'where' => 'civicrm_activity.is_deleted',
- 'headerPattern' => '/(activity.)?(trash|deleted)/i',
- 'export' => true,
- 'html' => array(
- 'type' => 'Text',
- ),
- 'uniqueName' => 'activity_is_deleted',
+ 'name' => 'is_deleted',
+ 'type' => 16,
+ 'title' => 'Activity is in the Trash',
+ 'import' => TRUE,
+ 'where' => 'civicrm_activity.is_deleted',
+ 'headerPattern' => '/(activity.)?(trash|deleted)/i',
+ 'export' => TRUE,
+ 'html' => array(
+ 'type' => 'Text',
),
+ 'uniqueName' => 'activity_is_deleted',
+ ),
'campaign_id' => array(
- 'name' => 'campaign_id',
- 'type' => 1,
- 'title' => 'Campaign',
- 'import' => true,
- 'where' => 'civicrm_activity.campaign_id',
- 'export' => true,
- 'FKClassName' => 'CRM_Campaign_DAO_Campaign',
- 'html' => array(
- 'type' => 'CheckBox',
- ),
- 'pseudoconstant' => array(
- 'table' => 'civicrm_campaign',
- 'keyColumn' => 'id',
- 'labelColumn' => 'title',
- ),
- 'uniqueName' => 'activity_campaign_id',
+ 'name' => 'campaign_id',
+ 'type' => 1,
+ 'title' => 'Campaign',
+ 'import' => TRUE,
+ 'where' => 'civicrm_activity.campaign_id',
+ 'export' => TRUE,
+ 'FKClassName' => 'CRM_Campaign_DAO_Campaign',
+ 'html' => array(
+ 'type' => 'CheckBox',
),
+ 'pseudoconstant' => array(
+ 'table' => 'civicrm_campaign',
+ 'keyColumn' => 'id',
+ 'labelColumn' => 'title',
+ ),
+ 'uniqueName' => 'activity_campaign_id',
+ 'FKApiName' => 'Campaign',
+ ),
'engagement_level' => array(
- 'name' => 'engagement_level',
- 'type' => 1,
- 'title' => 'Engagement Index',
- 'import' => true,
- 'where' => 'civicrm_activity.engagement_level',
- 'export' => true,
- 'html' => array(
- 'type' => 'Select',
- ),
- 'pseudoconstant' => array(
- 'optionGroupName' => 'engagement_index',
- ),
- 'uniqueName' => 'activity_engagement_level',
+ 'name' => 'engagement_level',
+ 'type' => 1,
+ 'title' => 'Engagement Index',
+ 'import' => TRUE,
+ 'where' => 'civicrm_activity.engagement_level',
+ 'export' => TRUE,
+ 'html' => array(
+ 'type' => 'Select',
),
- 'source_contact_id' => array(
- 'name' => 'source_contact_id',
- 'title' => 'Activity Source Contact',
- 'type' => 1,
- 'FKClassName' => 'CRM_Activity_DAO_ActivityContact',
- 'api.default' => 'user_contact_id',
+ 'pseudoconstant' => array(
+ 'optionGroupName' => 'engagement_index',
),
+ 'uniqueName' => 'activity_engagement_level',
+ ),
+ 'source_contact_id' => array(
+ 'name' => 'source_contact_id',
+ 'title' => 'Activity Source Contact',
+ 'type' => 1,
+ 'FKClassName' => 'CRM_Activity_DAO_ActivityContact',
+ 'api.default' => 'user_contact_id',
+ ),
'assignee_contact_id' => array(
- 'name' => 'assignee_id',
- 'title' => 'assigned to',
- 'type' => 1,
- 'FKClassName' => 'CRM_Activity_DAO_ActivityContact',
- ),
+ 'name' => 'assignee_id',
+ 'title' => 'assigned to',
+ 'type' => 1,
+ 'FKClassName' => 'CRM_Activity_DAO_ActivityContact',
+ ),
'target_contact_id' => array(
- 'name' => 'target_id',
- 'title' => 'Activity Target',
- 'type' => 1,
- 'FKClassName' => 'CRM_Activity_DAO_ActivityContact',
- ),
+ 'name' => 'target_id',
+ 'title' => 'Activity Target',
+ 'type' => 1,
+ 'FKClassName' => 'CRM_Activity_DAO_ActivityContact',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetFields and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetFields
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ActivityTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using activity get API
- * Function demonstrates getting asignee_contact_id & using it to get the contact *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function activity_get_example(){
-$params = array(
- 'activity_id' => 1,
- 'sequential' => 1,
- 'return.assignee_contact_id' => 1,
- 'api.contact.get' => array(
+
+/**
+ * Test Generated example of using activity get API.
+ *
+ * Function demonstrates getting asignee_contact_id & using it to get the contact
+ *
+ * @return array
+ * API result array
+ */
+function activity_get_example() {
+ $params = array(
+ 'activity_id' => 1,
+ 'sequential' => 1,
+ 'return.assignee_contact_id' => 1,
+ 'api.contact.get' => array(
'id' => '$value.source_contact_id',
),
-);
+ );
-try{
- $result = civicrm_api3('activity', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+ try{
+ $result = civicrm_api3('activity', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
-return $result;
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function activity_get_expectedresult(){
+function activity_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'0' => array(
- 'id' => '1',
- 'activity_type_id' => '49',
- 'subject' => 'test activity type id',
- 'activity_date_time' => '2011-06-02 14:36:13',
- 'duration' => '120',
- 'location' => 'Pensulvania',
- 'details' => 'a test activity',
- 'status_id' => '2',
- 'priority_id' => '1',
- 'is_test' => 0,
- 'is_auto' => 0,
- 'is_current_revision' => '1',
- 'is_deleted' => 0,
- 'assignee_contact_id' => array(
- '0' => '3',
- ),
- 'source_contact_id' => '1',
- 'api.contact.get' => array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
- '0' => array(
- 'contact_id' => '1',
- 'contact_type' => 'Individual',
- 'contact_sub_type' => '',
- 'sort_name' => 'Anderson, Anthony',
- 'display_name' => 'Mr. Anthony Anderson II',
- 'do_not_email' => 0,
- 'do_not_phone' => 0,
- 'do_not_mail' => 0,
- 'do_not_sms' => 0,
- 'do_not_trade' => 0,
- 'is_opt_out' => 0,
- 'legal_identifier' => '',
- 'external_identifier' => '',
- 'nick_name' => '',
- 'legal_name' => '',
- 'image_URL' => '',
- 'preferred_communication_method' => '',
- 'preferred_language' => 'en_US',
- 'preferred_mail_format' => 'Both',
- 'first_name' => 'Anthony',
- 'middle_name' => 'J.',
- 'last_name' => 'Anderson',
- 'prefix_id' => '3',
- 'suffix_id' => '3',
- 'formal_title' => '',
- 'communication_style_id' => '',
- 'job_title' => '',
- 'gender_id' => '',
- 'birth_date' => '',
- 'is_deceased' => 0,
- 'deceased_date' => '',
- 'household_name' => '',
- 'organization_name' => '',
- 'sic_code' => '',
- 'contact_is_deleted' => 0,
- 'current_employer' => '',
- 'address_id' => '',
- 'street_address' => '',
- 'supplemental_address_1' => '',
- 'supplemental_address_2' => '',
- 'city' => '',
- 'postal_code_suffix' => '',
- 'postal_code' => '',
- 'geo_code_1' => '',
- 'geo_code_2' => '',
- 'state_province_id' => '',
- 'country_id' => '',
- 'phone_id' => '',
- 'phone_type_id' => '',
- 'phone' => '',
- 'email_id' => '1',
- 'email' => 'anthony_anderson@civicrm.org',
- 'on_hold' => 0,
- 'im_id' => '',
- 'provider_id' => '',
- 'im' => '',
- 'worldregion_id' => '',
- 'world_region' => '',
- 'individual_prefix' => 'Mr.',
- 'individual_suffix' => 'II',
- 'communication_style' => '',
- 'gender' => '',
- 'state_province_name' => '',
- 'state_province' => '',
- 'country' => '',
- 'id' => '1',
- ),
- ),
+ 'id' => '1',
+ 'activity_type_id' => '51',
+ 'subject' => 'test activity type id',
+ 'activity_date_time' => '2011-06-02 14:36:13',
+ 'duration' => '120',
+ 'location' => 'Pensulvania',
+ 'details' => 'a test activity',
+ 'status_id' => '2',
+ 'priority_id' => '1',
+ 'is_test' => 0,
+ 'is_auto' => 0,
+ 'is_current_revision' => '1',
+ 'is_deleted' => 0,
+ 'assignee_contact_id' => array(
+ '0' => '3',
+ ),
+ 'source_contact_id' => '1',
+ 'api.contact.get' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
+ '0' => array(
+ 'contact_id' => '1',
+ 'contact_type' => 'Individual',
+ 'contact_sub_type' => '',
+ 'sort_name' => 'Anderson, Anthony',
+ 'display_name' => 'Mr. Anthony Anderson II',
+ 'do_not_email' => 0,
+ 'do_not_phone' => 0,
+ 'do_not_mail' => 0,
+ 'do_not_sms' => 0,
+ 'do_not_trade' => 0,
+ 'is_opt_out' => 0,
+ 'legal_identifier' => '',
+ 'external_identifier' => '',
+ 'nick_name' => '',
+ 'legal_name' => '',
+ 'image_URL' => '',
+ 'preferred_communication_method' => '',
+ 'preferred_language' => 'en_US',
+ 'preferred_mail_format' => 'Both',
+ 'first_name' => 'Anthony',
+ 'middle_name' => 'J.',
+ 'last_name' => 'Anderson',
+ 'prefix_id' => '3',
+ 'suffix_id' => '3',
+ 'formal_title' => '',
+ 'communication_style_id' => '',
+ 'job_title' => '',
+ 'gender_id' => '',
+ 'birth_date' => '',
+ 'is_deceased' => 0,
+ 'deceased_date' => '',
+ 'household_name' => '',
+ 'organization_name' => '',
+ 'sic_code' => '',
+ 'contact_is_deleted' => 0,
+ 'current_employer' => '',
+ 'address_id' => '',
+ 'street_address' => '',
+ 'supplemental_address_1' => '',
+ 'supplemental_address_2' => '',
+ 'city' => '',
+ 'postal_code_suffix' => '',
+ 'postal_code' => '',
+ 'geo_code_1' => '',
+ 'geo_code_2' => '',
+ 'state_province_id' => '',
+ 'country_id' => '',
+ 'phone_id' => '',
+ 'phone_type_id' => '',
+ 'phone' => '',
+ 'email_id' => '1',
+ 'email' => 'anthony_anderson@civicrm.org',
+ 'on_hold' => 0,
+ 'im_id' => '',
+ 'provider_id' => '',
+ 'im' => '',
+ 'worldregion_id' => '',
+ 'world_region' => '',
+ 'individual_prefix' => 'Mr.',
+ 'individual_suffix' => 'II',
+ 'communication_style' => '',
+ 'gender' => '',
+ 'state_province_name' => '',
+ 'state_province' => '',
+ 'country' => '',
+ 'id' => '1',
),
+ ),
),
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testActivityGetGoodID1 and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testActivityGetGoodID1
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ActivityTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using activity_contact create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function activity_contact_create_example(){
-$params = array(
- 'contact_id' => 3,
- 'activity_id' => 1,
- 'record_type_id' => 2,
-);
-try{
- $result = civicrm_api3('activity_contact', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using activity_contact create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function activity_contact_create_example() {
+ $params = array(
+ 'contact_id' => 3,
+ 'activity_id' => 1,
+ 'record_type_id' => 2,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('activity_contact', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function activity_contact_create_expectedresult(){
+function activity_contact_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
- '1' => array(
- 'id' => '1',
- 'activity_id' => '1',
- 'contact_id' => '3',
- 'record_type_id' => '2',
- ),
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 4,
+ 'values' => array(
+ '4' => array(
+ 'id' => '4',
+ 'activity_id' => '1',
+ 'contact_id' => '3',
+ 'record_type_id' => '2',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreateActivityContact and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreateActivityContact
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ActivityContactTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using activity_contact delete API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function activity_contact_delete_example(){
-$params = array(
- 'id' => 1,
-);
-try{
- $result = civicrm_api3('activity_contact', 'delete', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using activity_contact delete API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function activity_contact_delete_example() {
+ $params = array(
+ 'id' => 8,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('activity_contact', 'delete', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function activity_contact_delete_expectedresult(){
+function activity_contact_delete_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'values' => 1,
-);
+ '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
-*
-* testDeleteActivityContact and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testDeleteActivityContact
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ActivityContactTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using activity_type create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function activity_type_create_example(){
-$params = array(
- 'weight' => '2',
- 'label' => 'send out letters',
- 'filter' => 0,
- 'is_active' => 1,
- 'is_optgroup' => 1,
- 'is_default' => 0,
-);
-try{
- $result = civicrm_api3('activity_type', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using activity_type create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function activity_type_create_example() {
+ $params = array(
+ 'weight' => '2',
+ 'label' => 'send out letters',
+ 'filter' => 0,
+ 'is_active' => 1,
+ 'is_optgroup' => 1,
+ 'is_default' => 0,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('activity_type', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function activity_type_create_expectedresult(){
+function activity_type_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 764,
- 'values' => array(
- '764' => array(
- 'id' => '764',
- 'option_group_id' => '2',
- 'label' => 'send out letters',
- 'value' => '49',
- 'name' => 'send out letters',
- 'grouping' => '',
- 'filter' => 0,
- 'is_default' => 0,
- 'weight' => '2',
- 'description' => '',
- 'is_optgroup' => '1',
- 'is_reserved' => '',
- 'is_active' => '1',
- 'component_id' => '',
- 'domain_id' => '',
- 'visibility_id' => '',
- ),
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 780,
+ 'values' => array(
+ '780' => array(
+ 'id' => '780',
+ 'option_group_id' => '2',
+ 'label' => 'send out letters',
+ 'value' => '51',
+ 'name' => 'send out letters',
+ 'grouping' => '',
+ 'filter' => 0,
+ 'is_default' => 0,
+ 'weight' => '2',
+ 'description' => '',
+ 'is_optgroup' => '1',
+ 'is_reserved' => '',
+ 'is_active' => '1',
+ 'component_id' => '',
+ 'domain_id' => '',
+ 'visibility_id' => '',
+ ),
),
-);
+ 'deprecated' => 'The activity_type api is deprecated. Please use the option_value api instead.',
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testActivityTypeCreate and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testActivityTypeCreate
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ActivityTypeTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using activity_type get API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function activity_type_get_example(){
-$params = array();
-try{
- $result = civicrm_api3('activity_type', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using activity_type get API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function activity_type_get_example() {
+ $params = array();
-return $result;
+ try{
+ $result = civicrm_api3('activity_type', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function activity_type_get_expectedresult(){
+function activity_type_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 48,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 50,
+ 'values' => array(
'1' => 'Meeting',
'2' => 'Phone Call',
'3' => 'Email',
'46' => 'Payment',
'47' => 'Refund',
'48' => 'Change Registration',
+ '49' => 'Downloaded Invoice',
+ '50' => 'Emailed Invoice',
),
-);
+ 'deprecated' => 'The activity_type api is deprecated. Please use the option_value api instead.',
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testActivityTypeGet and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testActivityTypeGet
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ActivityTypeTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using address get API
- * Demonstrates Use of Like *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function address_get_example(){
-$params = array(
- 'street_address' => array(
+
+/**
+ * Test Generated example of using address get API.
+ *
+ * Demonstrates Use of Like
+ *
+ * @return array
+ * API result array
+ */
+function address_get_example() {
+ $params = array(
+ 'street_address' => array(
'LIKE' => '%mb%',
),
- 'sequential' => 1,
-);
+ 'sequential' => 1,
+ );
-try{
- $result = civicrm_api3('address', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+ try{
+ $result = civicrm_api3('address', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
-return $result;
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function address_get_expectedresult(){
+function address_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 10,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'0' => array(
- 'id' => '10',
- 'contact_id' => '12',
- 'location_type_id' => '15',
- 'is_primary' => '1',
- 'is_billing' => 0,
- 'street_address' => 'Ambachtstraat 23',
- 'street_number' => '23',
- 'street_name' => 'Ambachtstraat',
- 'city' => 'Brummen',
- 'postal_code' => '6971 BN',
- 'country_id' => '1152',
- 'manual_geo_code' => 0,
- ),
+ 'id' => '1',
+ 'contact_id' => '20',
+ 'location_type_id' => '18',
+ 'is_primary' => '1',
+ 'is_billing' => 0,
+ 'street_address' => 'Ambachtstraat 23',
+ 'street_number' => '23',
+ 'street_name' => 'Ambachtstraat',
+ 'city' => 'Brummen',
+ 'postal_code' => '6971 BN',
+ 'country_id' => '1152',
+ 'manual_geo_code' => 0,
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetAddressLikeSuccess and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetAddressLikeSuccess
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/AddressTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using address create API
- * Demonstrates Use of address parsing param *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function address_create_example(){
-$params = array(
- 'street_parsing' => 1,
- 'street_address' => '54A Excelsior Ave. Apt 1C',
- 'location_type_id' => 7,
- 'contact_id' => 4,
-);
-try{
- $result = civicrm_api3('address', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using address create API.
+ *
+ * Demonstrates Use of address parsing param
+ *
+ * @return array
+ * API result array
+ */
+function address_create_example() {
+ $params = array(
+ 'street_parsing' => 1,
+ 'street_address' => '54A Excelsior Ave. Apt 1C',
+ 'location_type_id' => 7,
+ 'contact_id' => 4,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('address', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function address_create_expectedresult(){
+function address_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 3,
- 'values' => array(
- '3' => array(
- 'id' => '3',
- 'contact_id' => '4',
- 'location_type_id' => '7',
- 'is_primary' => '1',
- 'is_billing' => 0,
- 'street_address' => '54A Excelsior Ave. Apt 1C',
- 'street_number' => '54',
- 'street_number_suffix' => 'A',
- 'street_name' => 'Excelsior Ave.',
- 'street_unit' => 'Apt 1C',
- 'manual_geo_code' => 0,
- ),
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
+ '1' => array(
+ 'id' => '1',
+ 'contact_id' => '4',
+ 'location_type_id' => '7',
+ 'is_primary' => '1',
+ 'is_billing' => 0,
+ 'street_address' => '54A Excelsior Ave. Apt 1C',
+ 'street_number' => '54',
+ 'street_number_suffix' => 'A',
+ 'street_name' => 'Excelsior Ave.',
+ 'street_unit' => 'Apt 1C',
+ 'manual_geo_code' => 0,
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreateAddressParsing and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreateAddressParsing
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/AddressTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using address get API
- * Demonstrates Use of sort filter *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function address_get_example(){
-$params = array(
- 'options' => array(
+
+/**
+ * Test Generated example of using address get API.
+ *
+ * Demonstrates Use of sort filter
+ *
+ * @return array
+ * API result array
+ */
+function address_get_example() {
+ $params = array(
+ 'options' => array(
'sort' => 'street_address DESC',
'limit' => 2,
),
- 'sequential' => 1,
-);
+ 'sequential' => 1,
+ );
-try{
- $result = civicrm_api3('address', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+ try{
+ $result = civicrm_api3('address', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
-return $result;
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function address_get_expectedresult(){
+function address_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 2,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 2,
+ 'values' => array(
'0' => array(
- 'id' => '9',
- 'contact_id' => '11',
- 'location_type_id' => '14',
- 'is_primary' => '1',
- 'is_billing' => 0,
- 'street_address' => 'Ambachtstraat 23',
- 'street_number' => '23',
- 'street_name' => 'Ambachtstraat',
- 'city' => 'Brummen',
- 'postal_code' => '6971 BN',
- 'country_id' => '1152',
- 'manual_geo_code' => 0,
- ),
+ 'id' => '2',
+ 'contact_id' => '19',
+ 'location_type_id' => '17',
+ 'is_primary' => '1',
+ 'is_billing' => 0,
+ 'street_address' => 'yzy',
+ 'street_number' => '23',
+ 'street_name' => 'Ambachtstraat',
+ 'city' => 'Brummen',
+ 'postal_code' => '6971 BN',
+ 'country_id' => '1152',
+ 'manual_geo_code' => 0,
+ ),
'1' => array(
- 'id' => '1',
- 'contact_id' => '2',
- 'location_type_id' => '1',
- 'is_primary' => '1',
- 'is_billing' => '1',
- 'street_address' => '15 Main St',
- 'street_number' => '15',
- 'street_number_suffix' => 'S',
- 'street_name' => 'Main',
- 'street_type' => 'St',
- 'city' => 'Collinsville',
- 'state_province_id' => '1006',
- 'postal_code' => '6022',
- 'country_id' => '1228',
- 'geo_code_1' => '41.8328',
- 'geo_code_2' => '-72.9253',
- 'manual_geo_code' => 0,
- ),
+ 'id' => '1',
+ 'contact_id' => '19',
+ 'location_type_id' => '17',
+ 'is_primary' => 0,
+ 'is_billing' => 0,
+ 'street_address' => 'Ambachtstraat 23',
+ 'street_number' => '23',
+ 'street_name' => 'Ambachtstraat',
+ 'city' => 'Brummen',
+ 'postal_code' => '6971 BN',
+ 'country_id' => '1152',
+ 'manual_geo_code' => 0,
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetAddressSort and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetAddressSort
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/AddressTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using address create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function address_create_example(){
-$params = array(
- 'contact_id' => 3,
- 'location_type_id' => 6,
- 'street_name' => 'Ambachtstraat',
- 'street_number' => '23',
- 'street_address' => 'Ambachtstraat 23',
- 'postal_code' => '6971 BN',
- 'country_id' => '1152',
- 'city' => 'Brummen',
- 'is_primary' => 1,
-);
-try{
- $result = civicrm_api3('address', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using address create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function address_create_example() {
+ $params = array(
+ 'contact_id' => 3,
+ 'location_type_id' => 6,
+ 'street_name' => 'Ambachtstraat',
+ 'street_number' => '23',
+ 'street_address' => 'Ambachtstraat 23',
+ 'postal_code' => '6971 BN',
+ 'country_id' => '1152',
+ 'city' => 'Brummen',
+ 'is_primary' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('address', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function address_create_expectedresult(){
+function address_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 2,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 2,
+ 'values' => array(
'2' => array(
- 'id' => '2',
- 'contact_id' => '3',
- 'location_type_id' => '6',
- 'is_primary' => '1',
- 'is_billing' => 0,
- 'street_address' => 'Ambachtstraat 23',
- 'street_number' => '23',
- 'street_name' => 'Ambachtstraat',
- 'city' => 'Brummen',
- 'postal_code' => '6971 BN',
- 'country_id' => '1152',
- 'manual_geo_code' => 0,
- ),
+ 'id' => '2',
+ 'contact_id' => '3',
+ 'location_type_id' => '6',
+ 'is_primary' => '1',
+ 'is_billing' => 0,
+ 'street_address' => 'Ambachtstraat 23',
+ 'street_number' => '23',
+ 'street_name' => 'Ambachtstraat',
+ 'city' => 'Brummen',
+ 'postal_code' => '6971 BN',
+ 'country_id' => '1152',
+ 'manual_geo_code' => 0,
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreateAddress and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreateAddress
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/AddressTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using address delete API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function address_delete_example(){
-$params = array(
- 'id' => 6,
-);
-try{
- $result = civicrm_api3('address', 'delete', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using address delete API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function address_delete_example() {
+ $params = array(
+ 'id' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('address', 'delete', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function address_delete_expectedresult(){
+function address_delete_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'values' => true,
-);
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'values' => TRUE,
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testDeleteAddress and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testDeleteAddress
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/AddressTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using address get API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function address_get_example(){
-$params = array(
- 'contact_id' => 9,
- 'street_name' => 'Ambachtstraat',
-);
-try{
- $result = civicrm_api3('address', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using address get API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function address_get_example() {
+ $params = array(
+ 'contact_id' => 17,
+ 'street_name' => 'Ambachtstraat',
+ );
-return $result;
+ try{
+ $result = civicrm_api3('address', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function address_get_expectedresult(){
+function address_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 7,
- 'values' => array(
- '7' => array(
- 'id' => '7',
- 'contact_id' => '9',
- 'location_type_id' => '12',
- 'is_primary' => '1',
- 'is_billing' => 0,
- 'street_address' => 'Ambachtstraat 23',
- 'street_number' => '23',
- 'street_name' => 'Ambachtstraat',
- 'city' => 'Brummen',
- 'postal_code' => '6971 BN',
- 'country_id' => '1152',
- 'manual_geo_code' => 0,
- ),
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
+ '1' => array(
+ 'id' => '1',
+ 'contact_id' => '17',
+ 'location_type_id' => '15',
+ 'is_primary' => '1',
+ 'is_billing' => 0,
+ 'street_address' => 'Ambachtstraat 23',
+ 'street_number' => '23',
+ 'street_name' => 'Ambachtstraat',
+ 'city' => 'Brummen',
+ 'postal_code' => '6971 BN',
+ 'country_id' => '1152',
+ 'manual_geo_code' => 0,
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetAddress and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetAddress
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/AddressTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using batch create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function batch_create_example(){
-$params = array(
- 'name' => 'New_Batch_03',
- 'title' => 'New Batch 03',
- 'description' => 'This is description for New Batch 03',
- 'total' => '300.33',
- 'item_count' => 3,
- 'status_id' => 1,
-);
-try{
- $result = civicrm_api3('batch', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using batch create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function batch_create_example() {
+ $params = array(
+ 'name' => 'New_Batch_03',
+ 'title' => 'New Batch 03',
+ 'description' => 'This is description for New Batch 03',
+ 'total' => '300.33',
+ 'item_count' => 3,
+ 'status_id' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('batch', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function batch_create_expectedresult(){
+function batch_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
- '1' => array(
- 'id' => '1',
- 'name' => 'New_Batch_03',
- 'title' => 'New Batch 03',
- 'description' => 'This is description for New Batch 03',
- 'created_id' => '',
- 'created_date' => '',
- 'modified_id' => '',
- 'modified_date' => '2012-11-14 16:02:35',
- 'saved_search_id' => '',
- 'status_id' => '1',
- 'type_id' => '',
- 'mode_id' => '',
- 'total' => '300.33',
- 'item_count' => '3',
- 'payment_instrument_id' => '',
- 'exported_date' => '',
- 'data' => '',
- ),
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 2,
+ 'values' => array(
+ '2' => array(
+ 'id' => '2',
+ 'name' => 'New_Batch_03',
+ 'title' => 'New Batch 03',
+ 'description' => 'This is description for New Batch 03',
+ 'created_id' => '',
+ 'created_date' => '',
+ 'modified_id' => '',
+ 'modified_date' => '2012-11-14 16:02:35',
+ 'saved_search_id' => '',
+ 'status_id' => '1',
+ 'type_id' => '',
+ 'mode_id' => '',
+ 'total' => '300.33',
+ 'item_count' => '3',
+ 'payment_instrument_id' => '',
+ 'exported_date' => '',
+ 'data' => '',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreate and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreate
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/BatchTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using batch delete API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function batch_delete_example(){
-$params = array(
- 'id' => 1,
-);
-try{
- $result = civicrm_api3('batch', 'delete', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using batch delete API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function batch_delete_example() {
+ $params = array(
+ 'id' => 5,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('batch', 'delete', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function batch_delete_expectedresult(){
+function batch_delete_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'values' => 1,
-);
+ '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
-*
-* testBatchDeleteCorrectSyntax and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testBatchDeleteCorrectSyntax
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/BatchTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using batch get API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function batch_get_example(){
-$params = array(
- 'id' => 1,
-);
-try{
- $result = civicrm_api3('batch', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using batch get API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function batch_get_example() {
+ $params = array(
+ 'id' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('batch', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function batch_get_expectedresult(){
+function batch_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'name' => 'Batch_433397',
- 'title' => 'Batch_433397',
- 'modified_date' => '2012-11-14 16:02:35',
- 'status_id' => '1',
- ),
+ 'id' => '1',
+ 'name' => 'Batch_433397',
+ 'title' => 'Batch_433397',
+ 'modified_date' => '2012-11-14 16:02:35',
+ 'status_id' => '1',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGet and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGet
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/BatchTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using batch update API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function batch_update_example(){
-$params = array(
- 'name' => 'New_Batch_04',
- 'title' => 'New Batch 04',
- 'description' => 'This is description for New Batch 04',
- 'total' => '400.44',
- 'item_count' => 4,
- 'id' => 1,
-);
-try{
- $result = civicrm_api3('batch', 'update', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using batch update API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function batch_update_example() {
+ $params = array(
+ 'name' => 'New_Batch_04',
+ 'title' => 'New Batch 04',
+ 'description' => 'This is description for New Batch 04',
+ 'total' => '400.44',
+ 'item_count' => 4,
+ 'id' => 3,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('batch', 'update', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function batch_update_expectedresult(){
+function batch_update_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
- '1' => array(
- 'id' => '1',
- 'name' => 'New_Batch_04',
- 'title' => 'New Batch 04',
- 'description' => 'This is description for New Batch 04',
- 'created_id' => '',
- 'created_date' => '',
- 'modified_id' => '',
- 'modified_date' => '',
- 'saved_search_id' => '',
- 'status_id' => '',
- 'type_id' => '',
- 'mode_id' => '',
- 'total' => '400.44',
- 'item_count' => '4',
- 'payment_instrument_id' => '',
- 'exported_date' => '',
- 'data' => '',
- ),
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 3,
+ 'values' => array(
+ '3' => array(
+ 'id' => '3',
+ 'name' => 'New_Batch_04',
+ 'title' => 'New Batch 04',
+ 'description' => 'This is description for New Batch 04',
+ 'created_id' => '',
+ 'created_date' => '',
+ 'modified_id' => '',
+ 'modified_date' => '',
+ 'saved_search_id' => '',
+ 'status_id' => '',
+ 'type_id' => '',
+ 'mode_id' => '',
+ 'total' => '400.44',
+ 'item_count' => '4',
+ 'payment_instrument_id' => '',
+ 'exported_date' => '',
+ 'data' => '',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testUpdate and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testUpdate
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/BatchTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using campaign create API
- * Create a campaign - Note use of relative dates here http://www.php.net/manual/en/datetime.formats.relative.php *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function campaign_create_example(){
-$params = array(
- 'title' => 'campaign title',
- 'description' => 'Call people, ask for money',
- 'created_date' => 'first sat of July 2008',
-);
-try{
- $result = civicrm_api3('campaign', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using campaign create API.
+ *
+ * Create a campaign - Note use of relative dates here http://www.php.net/manual/en/datetime.formats.relative.php
+ *
+ * @return array
+ * API result array
+ */
+function campaign_create_example() {
+ $params = array(
+ 'title' => 'campaign title',
+ 'description' => 'Call people, ask for money',
+ 'created_date' => 'first sat of July 2008',
+ );
-return $result;
+ try{
+ $result = civicrm_api3('campaign', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function campaign_create_expectedresult(){
+function campaign_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'name' => 'campaign_title',
- 'title' => 'campaign title',
- 'description' => 'Call people, ask for money',
- 'start_date' => '',
- 'end_date' => '',
- 'campaign_type_id' => '',
- 'status_id' => '',
- 'external_identifier' => '',
- 'parent_id' => '',
- 'is_active' => '',
- 'created_id' => '',
- 'created_date' => '2013-07-28 08:49:19',
- 'last_modified_id' => '',
- 'last_modified_date' => '',
- 'goal_general' => '',
- 'goal_revenue' => '',
- ),
+ 'id' => '1',
+ 'name' => 'campaign_title',
+ 'title' => 'campaign title',
+ 'description' => 'Call people, ask for money',
+ 'start_date' => '',
+ 'end_date' => '',
+ 'campaign_type_id' => '',
+ 'status_id' => '',
+ 'external_identifier' => '',
+ 'parent_id' => '',
+ 'is_active' => '',
+ 'created_id' => '',
+ 'created_date' => '2013-07-28 08:49:19',
+ 'last_modified_id' => '',
+ 'last_modified_date' => '',
+ 'goal_general' => '',
+ 'goal_revenue' => '',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreateCampaign and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreateCampaign
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/CampaignTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using campaign delete API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function campaign_delete_example(){
-$params = array(
- 'id' => 2,
-);
-try{
- $result = civicrm_api3('campaign', 'delete', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using campaign delete API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function campaign_delete_example() {
+ $params = array(
+ 'id' => 3,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('campaign', 'delete', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function campaign_delete_expectedresult(){
+function campaign_delete_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'values' => true,
-);
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'values' => TRUE,
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testDeleteCampaign and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testDeleteCampaign
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/CampaignTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using campaign get API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function campaign_get_example(){
-$params = array(
- 'title' => 'campaign title',
- 'description' => 'Call people, ask for money',
- 'created_date' => 'first sat of July 2008',
-);
-try{
- $result = civicrm_api3('campaign', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using campaign get API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function campaign_get_example() {
+ $params = array(
+ 'title' => 'campaign title',
+ 'description' => 'Call people, ask for money',
+ 'created_date' => 'first sat of July 2008',
+ );
-return $result;
+ try{
+ $result = civicrm_api3('campaign', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function campaign_get_expectedresult(){
+function campaign_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 2,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 2,
+ 'values' => array(
'2' => array(
- 'id' => '2',
- 'name' => 'campaign_title',
- 'title' => 'campaign title',
- 'description' => 'Call people, ask for money',
- 'is_active' => '1',
- 'created_date' => '2013-07-28 08:49:19',
- ),
+ 'id' => '2',
+ 'name' => 'campaign_title',
+ 'title' => 'campaign title',
+ 'description' => 'Call people, ask for money',
+ 'is_active' => '1',
+ 'created_date' => '2013-07-28 08:49:19',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetCampaign and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetCampaign
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/CampaignTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using case create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function case_create_example(){
-$params = array(
- 'subject' => 'Test case',
- 'contact_id' => 17,
- 'case_type' => 'housing_support',
-);
-try{
- $result = civicrm_api3('case', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using case create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function case_create_example() {
+ $params = array(
+ 'subject' => 'Test case',
+ 'contact_id' => 17,
+ 'case_type' => 'housing_support',
+ );
-return $result;
+ try{
+ $result = civicrm_api3('case', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function case_create_expectedresult(){
+function case_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 2,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 2,
+ 'values' => array(
'2' => array(
- 'id' => '2',
- 'case_type_id' => '1',
- 'subject' => 'Test case',
- 'start_date' => '2013-07-29 00:00:00',
- 'end_date' => '',
- 'details' => '',
- 'status_id' => '1',
- 'is_deleted' => '',
- ),
+ 'id' => '2',
+ 'case_type_id' => '1',
+ 'subject' => 'Test case',
+ 'start_date' => '2013-07-29 00:00:00',
+ 'end_date' => '',
+ 'details' => '',
+ 'status_id' => '1',
+ 'is_deleted' => '',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCaseCreate and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCaseCreate
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/CaseTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using constant get API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function constant_get_example(){
-$params = array(
- 'field' => 'location_type_id',
-);
-try{
- $result = civicrm_api3('constant', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using constant get API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function constant_get_example() {
+ $params = array(
+ 'field' => 'location_type_id',
+ );
-return $result;
+ try{
+ $result = civicrm_api3('constant', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function constant_get_expectedresult(){
+function constant_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 5,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 5,
+ 'values' => array(
'5' => 'Billing',
'1' => 'Home',
'3' => 'Main',
'4' => 'Other',
'2' => 'Work',
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testLocationTypeGet and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testLocationTypeGet
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ConstantTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using contact get API
- * /*this demonstrates the usage of chained api functions. In this case no notes or custom fields have been created *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function contact_get_example(){
-$params = array(
- 'id' => 1,
- 'api.website.get' => array(),
- 'api.Contribution.get' => array(
+
+/**
+ * Test Generated example of using contact get API.
+ *
+ * /*this demonstrates the usage of chained api functions. In this case no notes or custom fields have been created
+ *
+ * @return array
+ * API result array
+ */
+function contact_get_example() {
+ $params = array(
+ 'id' => 1,
+ 'api.website.get' => array(),
+ 'api.Contribution.get' => array(
'total_amount' => '120.00',
),
- 'api.CustomValue.get' => 1,
- 'api.Note.get' => 1,
-);
+ 'api.CustomValue.get' => 1,
+ 'api.Note.get' => 1,
+ );
-try{
- $result = civicrm_api3('contact', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+ try{
+ $result = civicrm_api3('contact', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
-return $result;
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function contact_get_expectedresult(){
+function contact_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'contact_id' => '1',
- 'contact_type' => 'Individual',
- 'contact_sub_type' => '',
- 'sort_name' => 'xyz3, abc3',
- 'display_name' => 'abc3 xyz3',
- 'do_not_email' => 0,
- 'do_not_phone' => 0,
- 'do_not_mail' => 0,
- 'do_not_sms' => 0,
- 'do_not_trade' => 0,
- 'is_opt_out' => 0,
- 'legal_identifier' => '',
- 'external_identifier' => '',
- 'nick_name' => '',
- 'legal_name' => '',
- 'image_URL' => '',
- 'preferred_communication_method' => '',
- 'preferred_language' => 'en_US',
- 'preferred_mail_format' => 'Both',
- 'first_name' => 'abc3',
- 'middle_name' => '',
- 'last_name' => 'xyz3',
- 'prefix_id' => '',
- 'suffix_id' => '',
- 'formal_title' => '',
- 'communication_style_id' => '',
- 'job_title' => '',
- 'gender_id' => '',
- 'birth_date' => '',
- 'is_deceased' => 0,
- 'deceased_date' => '',
- 'household_name' => '',
- 'organization_name' => '',
- 'sic_code' => '',
- 'contact_is_deleted' => 0,
- 'current_employer' => '',
- 'address_id' => '2',
- 'street_address' => '1 my road',
- 'supplemental_address_1' => '',
- 'supplemental_address_2' => '',
- 'city' => '',
- 'postal_code_suffix' => '',
- 'postal_code' => '',
- 'geo_code_1' => '',
- 'geo_code_2' => '',
- 'state_province_id' => '',
- 'country_id' => '',
- 'phone_id' => '',
- 'phone_type_id' => '',
- 'phone' => '',
- 'email_id' => '1',
- 'email' => 'man3@yahoo.com',
- 'on_hold' => 0,
- 'im_id' => '',
- 'provider_id' => '',
- 'im' => '',
- 'worldregion_id' => '',
- 'world_region' => '',
- 'individual_prefix' => '',
- 'individual_suffix' => '',
- 'communication_style' => '',
- 'gender' => '',
- 'state_province_name' => '',
- 'state_province' => '',
- 'country' => '',
- 'id' => '1',
- 'api.website.get' => array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
- '0' => array(
- 'id' => '1',
- 'contact_id' => '1',
- 'url' => 'http://civicrm.org',
- ),
- ),
- ),
- 'api.Contribution.get' => array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 2,
- 'values' => array(
- '0' => array(
- 'contact_id' => '1',
- 'contact_type' => 'Individual',
- 'contact_sub_type' => '',
- 'sort_name' => 'xyz3, abc3',
- 'display_name' => 'abc3 xyz3',
- 'contribution_id' => '2',
- 'currency' => 'USD',
- 'receive_date' => '2011-01-01 00:00:00',
- 'non_deductible_amount' => '10.00',
- 'total_amount' => '120.00',
- 'fee_amount' => '50.00',
- 'net_amount' => '90.00',
- 'trxn_id' => '12335',
- 'invoice_id' => '67830',
- 'cancel_date' => '',
- 'cancel_reason' => '',
- 'receipt_date' => '',
- 'thankyou_date' => '',
- 'contribution_source' => 'SSF',
- 'amount_level' => '',
- 'is_test' => 0,
- 'is_pay_later' => 0,
- 'contribution_status_id' => '1',
- 'check_number' => '',
- 'contribution_campaign_id' => '',
- 'financial_type_id' => '1',
- 'financial_type' => 'Donation',
- 'instrument_id' => '84',
- 'payment_instrument' => 'Credit Card',
- 'product_id' => '',
- 'product_name' => '',
- 'sku' => '',
- 'contribution_product_id' => '',
- 'product_option' => '',
- 'fulfilled_date' => '',
- 'contribution_start_date' => '',
- 'contribution_end_date' => '',
- 'contribution_recur_id' => '',
- 'financial_account_id' => '1',
- 'accounting_code' => '4200',
- 'contribution_note' => '',
- 'contribution_batch' => '',
- 'contribution_status' => 'Completed',
- 'contribution_payment_instrument' => 'Credit Card',
- 'contribution_check_number' => '',
- 'id' => '2',
- 'contribution_type_id' => '1',
- ),
- ),
- ),
- 'api.CustomValue.get' => array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 0,
- 'values' => array(),
+ 'contact_id' => '1',
+ 'contact_type' => 'Individual',
+ 'contact_sub_type' => '',
+ 'sort_name' => 'xyz3, abc3',
+ 'display_name' => 'abc3 xyz3',
+ 'do_not_email' => 0,
+ 'do_not_phone' => 0,
+ 'do_not_mail' => 0,
+ 'do_not_sms' => 0,
+ 'do_not_trade' => 0,
+ 'is_opt_out' => 0,
+ 'legal_identifier' => '',
+ 'external_identifier' => '',
+ 'nick_name' => '',
+ 'legal_name' => '',
+ 'image_URL' => '',
+ 'preferred_communication_method' => '',
+ 'preferred_language' => 'en_US',
+ 'preferred_mail_format' => 'Both',
+ 'first_name' => 'abc3',
+ 'middle_name' => '',
+ 'last_name' => 'xyz3',
+ 'prefix_id' => '',
+ 'suffix_id' => '',
+ 'formal_title' => '',
+ 'communication_style_id' => '',
+ 'job_title' => '',
+ 'gender_id' => '',
+ 'birth_date' => '',
+ 'is_deceased' => 0,
+ 'deceased_date' => '',
+ 'household_name' => '',
+ 'organization_name' => '',
+ 'sic_code' => '',
+ 'contact_is_deleted' => 0,
+ 'current_employer' => '',
+ 'address_id' => '2',
+ 'street_address' => '1 my road',
+ 'supplemental_address_1' => '',
+ 'supplemental_address_2' => '',
+ 'city' => '',
+ 'postal_code_suffix' => '',
+ 'postal_code' => '',
+ 'geo_code_1' => '',
+ 'geo_code_2' => '',
+ 'state_province_id' => '',
+ 'country_id' => '',
+ 'phone_id' => '',
+ 'phone_type_id' => '',
+ 'phone' => '',
+ 'email_id' => '1',
+ 'email' => 'man3@yahoo.com',
+ 'on_hold' => 0,
+ 'im_id' => '',
+ 'provider_id' => '',
+ 'im' => '',
+ 'worldregion_id' => '',
+ 'world_region' => '',
+ 'individual_prefix' => '',
+ 'individual_suffix' => '',
+ 'communication_style' => '',
+ 'gender' => '',
+ 'state_province_name' => '',
+ 'state_province' => '',
+ 'country' => '',
+ 'id' => '1',
+ 'api.website.get' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
+ '0' => array(
+ 'id' => '1',
+ 'contact_id' => '1',
+ 'url' => 'http://civicrm.org',
),
- 'api.Note.get' => array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 0,
- 'values' => array(),
+ ),
+ ),
+ 'api.Contribution.get' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 2,
+ 'values' => array(
+ '0' => array(
+ 'contact_id' => '1',
+ 'contact_type' => 'Individual',
+ 'contact_sub_type' => '',
+ 'sort_name' => 'xyz3, abc3',
+ 'display_name' => 'abc3 xyz3',
+ 'contribution_id' => '2',
+ 'currency' => 'USD',
+ 'receive_date' => '2011-01-01 00:00:00',
+ 'non_deductible_amount' => '10.00',
+ 'total_amount' => '120.00',
+ 'fee_amount' => '50.00',
+ 'net_amount' => '90.00',
+ 'trxn_id' => '12335',
+ 'invoice_id' => '67830',
+ 'cancel_date' => '',
+ 'cancel_reason' => '',
+ 'receipt_date' => '',
+ 'thankyou_date' => '',
+ 'contribution_source' => 'SSF',
+ 'amount_level' => '',
+ 'is_test' => 0,
+ 'is_pay_later' => 0,
+ 'contribution_status_id' => '1',
+ 'check_number' => '',
+ 'contribution_campaign_id' => '',
+ 'financial_type_id' => '1',
+ 'financial_type' => 'Donation',
+ 'instrument_id' => '86',
+ 'payment_instrument' => 'Credit Card',
+ 'product_id' => '',
+ 'product_name' => '',
+ 'sku' => '',
+ 'contribution_product_id' => '',
+ 'product_option' => '',
+ 'fulfilled_date' => '',
+ 'contribution_start_date' => '',
+ 'contribution_end_date' => '',
+ 'contribution_recur_id' => '',
+ 'financial_account_id' => '1',
+ 'accounting_code' => '4200',
+ 'contribution_note' => '',
+ 'contribution_batch' => '',
+ 'contribution_status' => 'Completed',
+ 'contribution_payment_instrument' => 'Credit Card',
+ 'contribution_check_number' => '',
+ 'id' => '2',
+ 'contribution_type_id' => '1',
),
+ ),
+ ),
+ 'api.CustomValue.get' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 0,
+ 'values' => array(),
+ ),
+ 'api.Note.get' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 0,
+ 'values' => array(),
),
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetIndividualWithChainedArrays and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetIndividualWithChainedArrays
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using contact get API
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
+ */
+
+/**
+ * Test Generated example of using contact get API.
+ *
* /*this demonstrates the usage of chained api functions. A variety of return formats are used. Note that no notes
- *custom fields or memberships exist *
+ *custom fields or memberships exist
+ *
+ * @return array
+ * API result array
*/
-function contact_get_example(){
-$params = array(
- 'id' => 1,
- 'api.website.getValue' => array(
+function contact_get_example() {
+ $params = array(
+ 'id' => 1,
+ 'api.website.getValue' => array(
'return' => 'url',
),
- 'api.Contribution.getCount' => array(),
- 'api.CustomValue.get' => 1,
- 'api.Note.get' => 1,
- 'api.Membership.getCount' => array(),
-);
+ 'api.Contribution.getCount' => array(),
+ 'api.CustomValue.get' => 1,
+ 'api.Note.get' => 1,
+ 'api.Membership.getCount' => array(),
+ );
-try{
- $result = civicrm_api3('contact', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+ try{
+ $result = civicrm_api3('contact', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
-return $result;
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function contact_get_expectedresult(){
+function contact_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'contact_id' => '1',
- 'contact_type' => 'Individual',
- 'contact_sub_type' => '',
- 'sort_name' => 'xyz3, abc3',
- 'display_name' => 'abc3 xyz3',
- 'do_not_email' => 0,
- 'do_not_phone' => 0,
- 'do_not_mail' => 0,
- 'do_not_sms' => 0,
- 'do_not_trade' => 0,
- 'is_opt_out' => 0,
- 'legal_identifier' => '',
- 'external_identifier' => '',
- 'nick_name' => '',
- 'legal_name' => '',
- 'image_URL' => '',
- 'preferred_communication_method' => '',
- 'preferred_language' => 'en_US',
- 'preferred_mail_format' => 'Both',
- 'first_name' => 'abc3',
- 'middle_name' => '',
- 'last_name' => 'xyz3',
- 'prefix_id' => '',
- 'suffix_id' => '',
- 'formal_title' => '',
- 'communication_style_id' => '',
- 'job_title' => '',
- 'gender_id' => '',
- 'birth_date' => '',
- 'is_deceased' => 0,
- 'deceased_date' => '',
- 'household_name' => '',
- 'organization_name' => '',
- 'sic_code' => '',
- 'contact_is_deleted' => 0,
- 'current_employer' => '',
- 'address_id' => '2',
- 'street_address' => '1 my road',
- 'supplemental_address_1' => '',
- 'supplemental_address_2' => '',
- 'city' => '',
- 'postal_code_suffix' => '',
- 'postal_code' => '',
- 'geo_code_1' => '',
- 'geo_code_2' => '',
- 'state_province_id' => '',
- 'country_id' => '',
- 'phone_id' => '',
- 'phone_type_id' => '',
- 'phone' => '',
- 'email_id' => '1',
- 'email' => 'man3@yahoo.com',
- 'on_hold' => 0,
- 'im_id' => '',
- 'provider_id' => '',
- 'im' => '',
- 'worldregion_id' => '',
- 'world_region' => '',
- 'individual_prefix' => '',
- 'individual_suffix' => '',
- 'communication_style' => '',
- 'gender' => '',
- 'state_province_name' => '',
- 'state_province' => '',
- 'country' => '',
- 'id' => '1',
- 'api.website.getValue' => 'http://civicrm.org',
- 'api.Contribution.getCount' => 2,
- 'api.CustomValue.get' => array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 0,
- 'values' => array(),
- ),
- 'api.Note.get' => array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 0,
- 'values' => array(),
- ),
- 'api.Membership.getCount' => 0,
+ 'contact_id' => '1',
+ 'contact_type' => 'Individual',
+ 'contact_sub_type' => '',
+ 'sort_name' => 'xyz3, abc3',
+ 'display_name' => 'abc3 xyz3',
+ 'do_not_email' => 0,
+ 'do_not_phone' => 0,
+ 'do_not_mail' => 0,
+ 'do_not_sms' => 0,
+ 'do_not_trade' => 0,
+ 'is_opt_out' => 0,
+ 'legal_identifier' => '',
+ 'external_identifier' => '',
+ 'nick_name' => '',
+ 'legal_name' => '',
+ 'image_URL' => '',
+ 'preferred_communication_method' => '',
+ 'preferred_language' => 'en_US',
+ 'preferred_mail_format' => 'Both',
+ 'first_name' => 'abc3',
+ 'middle_name' => '',
+ 'last_name' => 'xyz3',
+ 'prefix_id' => '',
+ 'suffix_id' => '',
+ 'formal_title' => '',
+ 'communication_style_id' => '',
+ 'job_title' => '',
+ 'gender_id' => '',
+ 'birth_date' => '',
+ 'is_deceased' => 0,
+ 'deceased_date' => '',
+ 'household_name' => '',
+ 'organization_name' => '',
+ 'sic_code' => '',
+ 'contact_is_deleted' => 0,
+ 'current_employer' => '',
+ 'address_id' => '2',
+ 'street_address' => '1 my road',
+ 'supplemental_address_1' => '',
+ 'supplemental_address_2' => '',
+ 'city' => '',
+ 'postal_code_suffix' => '',
+ 'postal_code' => '',
+ 'geo_code_1' => '',
+ 'geo_code_2' => '',
+ 'state_province_id' => '',
+ 'country_id' => '',
+ 'phone_id' => '',
+ 'phone_type_id' => '',
+ 'phone' => '',
+ 'email_id' => '1',
+ 'email' => 'man3@yahoo.com',
+ 'on_hold' => 0,
+ 'im_id' => '',
+ 'provider_id' => '',
+ 'im' => '',
+ 'worldregion_id' => '',
+ 'world_region' => '',
+ 'individual_prefix' => '',
+ 'individual_suffix' => '',
+ 'communication_style' => '',
+ 'gender' => '',
+ 'state_province_name' => '',
+ 'state_province' => '',
+ 'country' => '',
+ 'id' => '1',
+ 'api.website.getValue' => 'http://civicrm.org',
+ 'api.Contribution.getCount' => 2,
+ 'api.CustomValue.get' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 0,
+ 'values' => array(),
),
+ 'api.Note.get' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 0,
+ 'values' => array(),
+ ),
+ 'api.Membership.getCount' => 0,
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetIndividualWithChainedArraysFormats and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetIndividualWithChainedArraysFormats
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using contact get API
- * /*this demonstrates the usage of chained api functions. A variety of techniques are used *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function contact_get_example(){
-$params = array(
- 'id' => 1,
- 'api.website.getValue' => array(
+
+/**
+ * Test Generated example of using contact get API.
+ *
+ * /*this demonstrates the usage of chained api functions. A variety of techniques are used
+ *
+ * @return array
+ * API result array
+ */
+function contact_get_example() {
+ $params = array(
+ 'id' => 1,
+ 'api.website.getValue' => array(
'return' => 'url',
),
- 'api.Contribution.getCount' => array(),
- 'api.CustomValue.get' => 1,
-);
+ 'api.Contribution.getCount' => array(),
+ 'api.CustomValue.get' => 1,
+ );
-try{
- $result = civicrm_api3('contact', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+ try{
+ $result = civicrm_api3('contact', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
-return $result;
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function contact_get_expectedresult(){
+function contact_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'contact_id' => '1',
- 'contact_type' => 'Individual',
- 'contact_sub_type' => '',
- 'sort_name' => 'xyz3, abc3',
- 'display_name' => 'abc3 xyz3',
- 'do_not_email' => 0,
- 'do_not_phone' => 0,
- 'do_not_mail' => 0,
- 'do_not_sms' => 0,
- 'do_not_trade' => 0,
- 'is_opt_out' => 0,
- 'legal_identifier' => '',
- 'external_identifier' => '',
- 'nick_name' => '',
- 'legal_name' => '',
- 'image_URL' => '',
- 'preferred_communication_method' => '',
- 'preferred_language' => 'en_US',
- 'preferred_mail_format' => 'Both',
- 'first_name' => 'abc3',
- 'middle_name' => '',
- 'last_name' => 'xyz3',
- 'prefix_id' => '',
- 'suffix_id' => '',
- 'formal_title' => '',
- 'communication_style_id' => '',
- 'job_title' => '',
- 'gender_id' => '',
- 'birth_date' => '',
- 'is_deceased' => 0,
- 'deceased_date' => '',
- 'household_name' => '',
- 'organization_name' => '',
- 'sic_code' => '',
- 'contact_is_deleted' => 0,
- 'current_employer' => '',
- 'address_id' => '2',
- 'street_address' => '1 my road',
- 'supplemental_address_1' => '',
- 'supplemental_address_2' => '',
- 'city' => '',
- 'postal_code_suffix' => '',
- 'postal_code' => '',
- 'geo_code_1' => '',
- 'geo_code_2' => '',
- 'state_province_id' => '',
- 'country_id' => '',
- 'phone_id' => '',
- 'phone_type_id' => '',
- 'phone' => '',
- 'email_id' => '1',
- 'email' => 'man3@yahoo.com',
- 'on_hold' => 0,
- 'im_id' => '',
- 'provider_id' => '',
- 'im' => '',
- 'worldregion_id' => '',
- 'world_region' => '',
- 'individual_prefix' => '',
- 'individual_suffix' => '',
- 'communication_style' => '',
- 'gender' => '',
- 'state_province_name' => '',
- 'state_province' => '',
- 'country' => '',
- 'id' => '1',
- 'api.website.getValue' => 'http://civicrm.org',
- 'api.Contribution.getCount' => 2,
- 'api.CustomValue.get' => array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 8,
- 'values' => array(
- '0' => array(
- 'entity_id' => '1',
- 'latest' => 'value 4',
- 'id' => '1',
- 'entity_table' => 'Contact',
- ),
- '1' => array(
- 'entity_table' => 'Contact',
- ),
- '2' => array(
- 'entity_id' => '1',
- 'latest' => 'value 3',
- 'id' => '2',
- '1' => 'value 2',
- 'entity_table' => 'Contact',
- '2' => 'value 3',
- ),
- '3' => array(
- 'entity_id' => '1',
- 'latest' => '',
- 'id' => '3',
- '1' => 'warm beer',
- '2' => '',
- ),
- '4' => array(
- 'entity_id' => '1',
- 'latest' => '',
- 'id' => '4',
- '1' => '',
- '2' => '',
- ),
- '5' => array(
- 'entity_id' => '1',
- 'latest' => 'defaultValue',
- 'id' => '5',
- '1' => 'defaultValue',
- ),
- '6' => array(
- 'entity_id' => '1',
- 'latest' => 'vegemite',
- 'id' => '6',
- '1' => 'vegemite',
- ),
- '7' => array(
- 'entity_id' => '1',
- 'latest' => '',
- 'id' => '7',
- '1' => '',
- ),
- ),
+ 'contact_id' => '1',
+ 'contact_type' => 'Individual',
+ 'contact_sub_type' => '',
+ 'sort_name' => 'xyz3, abc3',
+ 'display_name' => 'abc3 xyz3',
+ 'do_not_email' => 0,
+ 'do_not_phone' => 0,
+ 'do_not_mail' => 0,
+ 'do_not_sms' => 0,
+ 'do_not_trade' => 0,
+ 'is_opt_out' => 0,
+ 'legal_identifier' => '',
+ 'external_identifier' => '',
+ 'nick_name' => '',
+ 'legal_name' => '',
+ 'image_URL' => '',
+ 'preferred_communication_method' => '',
+ 'preferred_language' => 'en_US',
+ 'preferred_mail_format' => 'Both',
+ 'first_name' => 'abc3',
+ 'middle_name' => '',
+ 'last_name' => 'xyz3',
+ 'prefix_id' => '',
+ 'suffix_id' => '',
+ 'formal_title' => '',
+ 'communication_style_id' => '',
+ 'job_title' => '',
+ 'gender_id' => '',
+ 'birth_date' => '',
+ 'is_deceased' => 0,
+ 'deceased_date' => '',
+ 'household_name' => '',
+ 'organization_name' => '',
+ 'sic_code' => '',
+ 'contact_is_deleted' => 0,
+ 'current_employer' => '',
+ 'address_id' => '2',
+ 'street_address' => '1 my road',
+ 'supplemental_address_1' => '',
+ 'supplemental_address_2' => '',
+ 'city' => '',
+ 'postal_code_suffix' => '',
+ 'postal_code' => '',
+ 'geo_code_1' => '',
+ 'geo_code_2' => '',
+ 'state_province_id' => '',
+ 'country_id' => '',
+ 'phone_id' => '',
+ 'phone_type_id' => '',
+ 'phone' => '',
+ 'email_id' => '1',
+ 'email' => 'man3@yahoo.com',
+ 'on_hold' => 0,
+ 'im_id' => '',
+ 'provider_id' => '',
+ 'im' => '',
+ 'worldregion_id' => '',
+ 'world_region' => '',
+ 'individual_prefix' => '',
+ 'individual_suffix' => '',
+ 'communication_style' => '',
+ 'gender' => '',
+ 'state_province_name' => '',
+ 'state_province' => '',
+ 'country' => '',
+ 'id' => '1',
+ 'api.website.getValue' => 'http://civicrm.org',
+ 'api.Contribution.getCount' => 2,
+ 'api.CustomValue.get' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 8,
+ 'values' => array(
+ '0' => array(
+ 'entity_id' => '1',
+ 'latest' => 'value 4',
+ 'id' => '1',
+ 'entity_table' => 'Contact',
+ ),
+ '1' => array(
+ 'entity_table' => 'Contact',
+ ),
+ '2' => array(
+ 'entity_id' => '1',
+ 'latest' => 'value 3',
+ 'id' => '2',
+ '1' => 'value 2',
+ 'entity_table' => 'Contact',
+ '2' => 'value 3',
+ ),
+ '3' => array(
+ 'entity_id' => '1',
+ 'latest' => '',
+ 'id' => '3',
+ '1' => 'warm beer',
+ '2' => '',
),
+ '4' => array(
+ 'entity_id' => '1',
+ 'latest' => '',
+ 'id' => '4',
+ '1' => '',
+ '2' => '',
+ ),
+ '5' => array(
+ 'entity_id' => '1',
+ 'latest' => 'defaultValue',
+ 'id' => '5',
+ '1' => 'defaultValue',
+ ),
+ '6' => array(
+ 'entity_id' => '1',
+ 'latest' => 'vegemite',
+ 'id' => '6',
+ '1' => 'vegemite',
+ ),
+ '7' => array(
+ 'entity_id' => '1',
+ 'latest' => '',
+ 'id' => '7',
+ '1' => '',
+ ),
+ ),
),
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetIndividualWithChainedArraysAndMultipleCustom and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetIndividualWithChainedArraysAndMultipleCustom
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using contact create API
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
+ */
+
+/**
+ * Test Generated example of using contact create API.
+ *
* /*this demonstrates the usage of chained api functions. Specifically it has one 'parent function' &
- 2 child functions - one receives values from the parent (Contact) and the other child (Tag). *
+ 2 child functions - one receives values from the parent (Contact) and the other child (Tag).
+ *
+ * @return array
+ * API result array
*/
-function contact_create_example(){
-$params = array(
- 'display_name' => 'batman',
- 'contact_type' => 'Individual',
- 'api.tag.create' => array(
+function contact_create_example() {
+ $params = array(
+ 'display_name' => 'batman',
+ 'contact_type' => 'Individual',
+ 'api.tag.create' => array(
'name' => '$value.id',
'description' => '$value.display_name',
'format.only_id' => 1,
),
- 'api.entity_tag.create' => array(
+ 'api.entity_tag.create' => array(
'tag_id' => '$value.api.tag.create',
),
-);
+ );
-try{
- $result = civicrm_api3('contact', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+ try{
+ $result = civicrm_api3('contact', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
-return $result;
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function contact_create_expectedresult(){
+function contact_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'contact_type' => 'Individual',
- 'contact_sub_type' => '',
- 'do_not_email' => 0,
- 'do_not_phone' => 0,
- 'do_not_mail' => 0,
- 'do_not_sms' => 0,
- 'do_not_trade' => 0,
- 'is_opt_out' => 0,
- 'legal_identifier' => '',
- 'external_identifier' => '',
- 'sort_name' => '',
- 'display_name' => 'batman',
- 'nick_name' => '',
- 'legal_name' => '',
- 'image_URL' => '',
- 'preferred_communication_method' => '',
- 'preferred_language' => 'en_US',
- 'preferred_mail_format' => 'Both',
- 'hash' => '67eac7789eaee00',
- 'api_key' => '',
- 'first_name' => '',
- 'middle_name' => '',
- 'last_name' => '',
- 'prefix_id' => '',
- 'suffix_id' => '',
- 'formal_title' => '',
- 'communication_style_id' => '',
- 'email_greeting_id' => '1',
- 'email_greeting_custom' => '',
- 'email_greeting_display' => '',
- 'postal_greeting_id' => '1',
- 'postal_greeting_custom' => '',
- 'postal_greeting_display' => '',
- 'addressee_id' => '1',
- 'addressee_custom' => '',
- 'addressee_display' => '',
- 'job_title' => '',
- 'gender_id' => '',
- 'birth_date' => '',
- 'is_deceased' => 0,
- 'deceased_date' => '',
- 'household_name' => '',
- 'primary_contact_id' => '',
- 'organization_name' => '',
- 'sic_code' => '',
- 'user_unique_id' => '',
- 'created_date' => '2013-07-28 08:49:19',
- 'modified_date' => '2012-11-14 16:02:35',
- 'api.tag.create' => 6,
- 'api.entity_tag.create' => array(
- 'is_error' => 0,
- 'not_added' => 1,
- 'added' => 1,
- 'total_count' => 2,
- ),
+ 'id' => '1',
+ 'contact_type' => 'Individual',
+ 'contact_sub_type' => '',
+ 'do_not_email' => 0,
+ 'do_not_phone' => 0,
+ 'do_not_mail' => 0,
+ 'do_not_sms' => 0,
+ 'do_not_trade' => 0,
+ 'is_opt_out' => 0,
+ 'legal_identifier' => '',
+ 'external_identifier' => '',
+ 'sort_name' => '',
+ 'display_name' => 'batman',
+ 'nick_name' => '',
+ 'legal_name' => '',
+ 'image_URL' => '',
+ 'preferred_communication_method' => '',
+ 'preferred_language' => 'en_US',
+ 'preferred_mail_format' => 'Both',
+ 'hash' => '67eac7789eaee00',
+ 'api_key' => '',
+ 'first_name' => '',
+ 'middle_name' => '',
+ 'last_name' => '',
+ 'prefix_id' => '',
+ 'suffix_id' => '',
+ 'formal_title' => '',
+ 'communication_style_id' => '',
+ 'email_greeting_id' => '1',
+ 'email_greeting_custom' => '',
+ 'email_greeting_display' => '',
+ 'postal_greeting_id' => '1',
+ 'postal_greeting_custom' => '',
+ 'postal_greeting_display' => '',
+ 'addressee_id' => '1',
+ 'addressee_custom' => '',
+ 'addressee_display' => '',
+ 'job_title' => '',
+ 'gender_id' => '',
+ 'birth_date' => '',
+ 'is_deceased' => 0,
+ 'deceased_date' => '',
+ 'household_name' => '',
+ 'primary_contact_id' => '',
+ 'organization_name' => '',
+ 'sic_code' => '',
+ 'user_unique_id' => '',
+ 'created_date' => '2013-07-28 08:49:19',
+ 'modified_date' => '2012-11-14 16:02:35',
+ 'api.tag.create' => 6,
+ 'api.entity_tag.create' => array(
+ 'is_error' => 0,
+ 'not_added' => 1,
+ 'added' => 1,
+ 'total_count' => 2,
),
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testChainingValuesCreate and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testChainingValuesCreate
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using contact create API
- * test demonstrates the syntax to create 2 chained entities *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function contact_create_example(){
-$params = array(
- 'first_name' => 'abc3',
- 'last_name' => 'xyz3',
- 'contact_type' => 'Individual',
- 'email' => 'man3@yahoo.com',
- 'api.contribution.create' => array(
+
+/**
+ * Test Generated example of using contact create API.
+ *
+ * test demonstrates the syntax to create 2 chained entities
+ *
+ * @return array
+ * API result array
+ */
+function contact_create_example() {
+ $params = array(
+ 'first_name' => 'abc3',
+ 'last_name' => 'xyz3',
+ 'contact_type' => 'Individual',
+ 'email' => 'man3@yahoo.com',
+ 'api.contribution.create' => array(
'receive_date' => '2010-01-01',
'total_amount' => '100',
'financial_type_id' => 1,
'source' => 'SSF',
'contribution_status_id' => 1,
),
- 'api.website.create' => array(
+ 'api.website.create' => array(
'url' => 'http://civicrm.org',
),
- 'api.website.create.2' => array(
+ 'api.website.create.2' => array(
'url' => 'http://chained.org',
),
-);
+ );
-try{
- $result = civicrm_api3('contact', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+ try{
+ $result = civicrm_api3('contact', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
-return $result;
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function contact_create_expectedresult(){
+function contact_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'contact_type' => 'Individual',
- 'contact_sub_type' => '',
- 'do_not_email' => 0,
- 'do_not_phone' => 0,
- 'do_not_mail' => 0,
- 'do_not_sms' => 0,
- 'do_not_trade' => 0,
- 'is_opt_out' => 0,
- 'legal_identifier' => '',
- 'external_identifier' => '',
- 'sort_name' => 'xyz3, abc3',
- 'display_name' => 'abc3 xyz3',
- 'nick_name' => '',
- 'legal_name' => '',
- 'image_URL' => '',
- 'preferred_communication_method' => '',
- 'preferred_language' => 'en_US',
- 'preferred_mail_format' => 'Both',
- 'hash' => '67eac7789eaee00',
- 'api_key' => '',
- 'first_name' => 'abc3',
- 'middle_name' => '',
- 'last_name' => 'xyz3',
- 'prefix_id' => '',
- 'suffix_id' => '',
- 'formal_title' => '',
- 'communication_style_id' => '',
- 'email_greeting_id' => '1',
- 'email_greeting_custom' => '',
- 'email_greeting_display' => '',
- 'postal_greeting_id' => '1',
- 'postal_greeting_custom' => '',
- 'postal_greeting_display' => '',
- 'addressee_id' => '1',
- 'addressee_custom' => '',
- 'addressee_display' => '',
- 'job_title' => '',
- 'gender_id' => '',
- 'birth_date' => '',
- 'is_deceased' => 0,
- 'deceased_date' => '',
- 'household_name' => '',
- 'primary_contact_id' => '',
- 'organization_name' => '',
- 'sic_code' => '',
- 'user_unique_id' => '',
- 'created_date' => '2013-07-28 08:49:19',
- 'modified_date' => '2012-11-14 16:02:35',
- 'api.contribution.create' => array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
- '0' => array(
- 'id' => '1',
- 'contact_id' => '1',
- 'financial_type_id' => '1',
- 'contribution_page_id' => '',
- 'payment_instrument_id' => '1',
- 'receive_date' => '20100101000000',
- 'non_deductible_amount' => '10',
- 'total_amount' => '100',
- 'fee_amount' => '50',
- 'net_amount' => '90',
- 'trxn_id' => '15345',
- 'invoice_id' => '67990',
- 'currency' => 'USD',
- 'cancel_date' => '',
- 'cancel_reason' => '',
- 'receipt_date' => '',
- 'thankyou_date' => '',
- 'source' => 'SSF',
- 'amount_level' => '',
- 'contribution_recur_id' => '',
- 'is_test' => '',
- 'is_pay_later' => '',
- 'contribution_status_id' => '1',
- 'address_id' => '',
- 'check_number' => '',
- 'campaign_id' => '',
- 'contribution_type_id' => '1',
- ),
- ),
+ 'id' => '1',
+ 'contact_type' => 'Individual',
+ 'contact_sub_type' => '',
+ 'do_not_email' => 0,
+ 'do_not_phone' => 0,
+ 'do_not_mail' => 0,
+ 'do_not_sms' => 0,
+ 'do_not_trade' => 0,
+ 'is_opt_out' => 0,
+ 'legal_identifier' => '',
+ 'external_identifier' => '',
+ 'sort_name' => 'xyz3, abc3',
+ 'display_name' => 'abc3 xyz3',
+ 'nick_name' => '',
+ 'legal_name' => '',
+ 'image_URL' => '',
+ 'preferred_communication_method' => '',
+ 'preferred_language' => 'en_US',
+ 'preferred_mail_format' => 'Both',
+ 'hash' => '67eac7789eaee00',
+ 'api_key' => '',
+ 'first_name' => 'abc3',
+ 'middle_name' => '',
+ 'last_name' => 'xyz3',
+ 'prefix_id' => '',
+ 'suffix_id' => '',
+ 'formal_title' => '',
+ 'communication_style_id' => '',
+ 'email_greeting_id' => '1',
+ 'email_greeting_custom' => '',
+ 'email_greeting_display' => '',
+ 'postal_greeting_id' => '1',
+ 'postal_greeting_custom' => '',
+ 'postal_greeting_display' => '',
+ 'addressee_id' => '1',
+ 'addressee_custom' => '',
+ 'addressee_display' => '',
+ 'job_title' => '',
+ 'gender_id' => '',
+ 'birth_date' => '',
+ 'is_deceased' => 0,
+ 'deceased_date' => '',
+ 'household_name' => '',
+ 'primary_contact_id' => '',
+ 'organization_name' => '',
+ 'sic_code' => '',
+ 'user_unique_id' => '',
+ 'created_date' => '2013-07-28 08:49:19',
+ 'modified_date' => '2012-11-14 16:02:35',
+ 'api.contribution.create' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
+ '0' => array(
+ 'id' => '1',
+ 'contact_id' => '1',
+ 'financial_type_id' => '1',
+ 'contribution_page_id' => '',
+ 'payment_instrument_id' => '1',
+ 'receive_date' => '20100101000000',
+ 'non_deductible_amount' => '10',
+ 'total_amount' => '100',
+ 'fee_amount' => '50',
+ 'net_amount' => '90',
+ 'trxn_id' => '15345',
+ 'invoice_id' => '67990',
+ 'currency' => 'USD',
+ 'cancel_date' => '',
+ 'cancel_reason' => '',
+ 'receipt_date' => '',
+ 'thankyou_date' => '',
+ 'source' => 'SSF',
+ 'amount_level' => '',
+ 'contribution_recur_id' => '',
+ 'is_test' => '',
+ 'is_pay_later' => '',
+ 'contribution_status_id' => '1',
+ 'address_id' => '',
+ 'check_number' => '',
+ 'campaign_id' => '',
+ 'creditnote_id' => '',
+ 'tax_amount' => '',
+ 'contribution_type_id' => '1',
),
- 'api.website.create' => array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
- '0' => array(
- 'id' => '1',
- 'contact_id' => '1',
- 'url' => 'http://civicrm.org',
- 'website_type_id' => '',
- ),
- ),
+ ),
+ ),
+ 'api.website.create' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
+ '0' => array(
+ 'id' => '1',
+ 'contact_id' => '1',
+ 'url' => 'http://civicrm.org',
+ 'website_type_id' => '',
),
- 'api.website.create.2' => array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 2,
- 'values' => array(
- '0' => array(
- 'id' => '2',
- 'contact_id' => '1',
- 'url' => 'http://chained.org',
- 'website_type_id' => '',
- ),
- ),
+ ),
+ ),
+ 'api.website.create.2' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 2,
+ 'values' => array(
+ '0' => array(
+ 'id' => '2',
+ 'contact_id' => '1',
+ 'url' => 'http://chained.org',
+ 'website_type_id' => '',
),
+ ),
),
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreateIndividualWithContributionDottedSyntax and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreateIndividualWithContributionDottedSyntax
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using contact create API
- * demonstrates creating two websites as an array *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function contact_create_example(){
-$params = array(
- 'first_name' => 'abc3',
- 'last_name' => 'xyz3',
- 'contact_type' => 'Individual',
- 'email' => 'man3@yahoo.com',
- 'api.contribution.create' => array(
+
+/**
+ * Test Generated example of using contact create API.
+ *
+ * demonstrates creating two websites as an array
+ *
+ * @return array
+ * API result array
+ */
+function contact_create_example() {
+ $params = array(
+ 'first_name' => 'abc3',
+ 'last_name' => 'xyz3',
+ 'contact_type' => 'Individual',
+ 'email' => 'man3@yahoo.com',
+ 'api.contribution.create' => array(
'receive_date' => '2010-01-01',
'total_amount' => '100',
'financial_type_id' => 1,
'source' => 'SSF',
'contribution_status_id' => 1,
),
- 'api.website.create' => array(
+ 'api.website.create' => array(
'0' => array(
- 'url' => 'http://civicrm.org',
- ),
+ 'url' => 'http://civicrm.org',
+ ),
'1' => array(
- 'url' => 'http://chained.org',
- 'website_type_id' => 2,
- ),
+ 'url' => 'http://chained.org',
+ 'website_type_id' => 2,
+ ),
),
-);
+ );
-try{
- $result = civicrm_api3('contact', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+ try{
+ $result = civicrm_api3('contact', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
-return $result;
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function contact_create_expectedresult(){
+function contact_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'contact_type' => 'Individual',
- 'contact_sub_type' => '',
- 'do_not_email' => 0,
- 'do_not_phone' => 0,
- 'do_not_mail' => 0,
- 'do_not_sms' => 0,
- 'do_not_trade' => 0,
- 'is_opt_out' => 0,
- 'legal_identifier' => '',
- 'external_identifier' => '',
- 'sort_name' => 'xyz3, abc3',
- 'display_name' => 'abc3 xyz3',
- 'nick_name' => '',
- 'legal_name' => '',
- 'image_URL' => '',
- 'preferred_communication_method' => '',
- 'preferred_language' => 'en_US',
- 'preferred_mail_format' => 'Both',
- 'hash' => '67eac7789eaee00',
- 'api_key' => '',
- 'first_name' => 'abc3',
- 'middle_name' => '',
- 'last_name' => 'xyz3',
- 'prefix_id' => '',
- 'suffix_id' => '',
- 'formal_title' => '',
- 'communication_style_id' => '',
- 'email_greeting_id' => '1',
- 'email_greeting_custom' => '',
- 'email_greeting_display' => '',
- 'postal_greeting_id' => '1',
- 'postal_greeting_custom' => '',
- 'postal_greeting_display' => '',
- 'addressee_id' => '1',
- 'addressee_custom' => '',
- 'addressee_display' => '',
- 'job_title' => '',
- 'gender_id' => '',
- 'birth_date' => '',
- 'is_deceased' => 0,
- 'deceased_date' => '',
- 'household_name' => '',
- 'primary_contact_id' => '',
- 'organization_name' => '',
- 'sic_code' => '',
- 'user_unique_id' => '',
- 'created_date' => '2013-07-28 08:49:19',
- 'modified_date' => '2012-11-14 16:02:35',
- 'api.contribution.create' => array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
- '0' => array(
- 'id' => '1',
- 'contact_id' => '1',
- 'financial_type_id' => '1',
- 'contribution_page_id' => '',
- 'payment_instrument_id' => '1',
- 'receive_date' => '20100101000000',
- 'non_deductible_amount' => '10',
- 'total_amount' => '100',
- 'fee_amount' => '50',
- 'net_amount' => '90',
- 'trxn_id' => '12345',
- 'invoice_id' => '67890',
- 'currency' => 'USD',
- 'cancel_date' => '',
- 'cancel_reason' => '',
- 'receipt_date' => '',
- 'thankyou_date' => '',
- 'source' => 'SSF',
- 'amount_level' => '',
- 'contribution_recur_id' => '',
- 'is_test' => '',
- 'is_pay_later' => '',
- 'contribution_status_id' => '1',
- 'address_id' => '',
- 'check_number' => '',
- 'campaign_id' => '',
- 'contribution_type_id' => '1',
- ),
- ),
+ 'id' => '1',
+ 'contact_type' => 'Individual',
+ 'contact_sub_type' => '',
+ 'do_not_email' => 0,
+ 'do_not_phone' => 0,
+ 'do_not_mail' => 0,
+ 'do_not_sms' => 0,
+ 'do_not_trade' => 0,
+ 'is_opt_out' => 0,
+ 'legal_identifier' => '',
+ 'external_identifier' => '',
+ 'sort_name' => 'xyz3, abc3',
+ 'display_name' => 'abc3 xyz3',
+ 'nick_name' => '',
+ 'legal_name' => '',
+ 'image_URL' => '',
+ 'preferred_communication_method' => '',
+ 'preferred_language' => 'en_US',
+ 'preferred_mail_format' => 'Both',
+ 'hash' => '67eac7789eaee00',
+ 'api_key' => '',
+ 'first_name' => 'abc3',
+ 'middle_name' => '',
+ 'last_name' => 'xyz3',
+ 'prefix_id' => '',
+ 'suffix_id' => '',
+ 'formal_title' => '',
+ 'communication_style_id' => '',
+ 'email_greeting_id' => '1',
+ 'email_greeting_custom' => '',
+ 'email_greeting_display' => '',
+ 'postal_greeting_id' => '1',
+ 'postal_greeting_custom' => '',
+ 'postal_greeting_display' => '',
+ 'addressee_id' => '1',
+ 'addressee_custom' => '',
+ 'addressee_display' => '',
+ 'job_title' => '',
+ 'gender_id' => '',
+ 'birth_date' => '',
+ 'is_deceased' => 0,
+ 'deceased_date' => '',
+ 'household_name' => '',
+ 'primary_contact_id' => '',
+ 'organization_name' => '',
+ 'sic_code' => '',
+ 'user_unique_id' => '',
+ 'created_date' => '2013-07-28 08:49:19',
+ 'modified_date' => '2012-11-14 16:02:35',
+ 'api.contribution.create' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
+ '0' => array(
+ 'id' => '1',
+ 'contact_id' => '1',
+ 'financial_type_id' => '1',
+ 'contribution_page_id' => '',
+ 'payment_instrument_id' => '1',
+ 'receive_date' => '20100101000000',
+ 'non_deductible_amount' => '10',
+ 'total_amount' => '100',
+ 'fee_amount' => '50',
+ 'net_amount' => '90',
+ 'trxn_id' => '12345',
+ 'invoice_id' => '67890',
+ 'currency' => 'USD',
+ 'cancel_date' => '',
+ 'cancel_reason' => '',
+ 'receipt_date' => '',
+ 'thankyou_date' => '',
+ 'source' => 'SSF',
+ 'amount_level' => '',
+ 'contribution_recur_id' => '',
+ 'is_test' => '',
+ 'is_pay_later' => '',
+ 'contribution_status_id' => '1',
+ 'address_id' => '',
+ 'check_number' => '',
+ 'campaign_id' => '',
+ 'creditnote_id' => '',
+ 'tax_amount' => '',
+ 'contribution_type_id' => '1',
),
- 'api.website.create' => array(
+ ),
+ ),
+ 'api.website.create' => array(
+ '0' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
+ '0' => array(
+ 'id' => '1',
+ 'contact_id' => '1',
+ 'url' => 'http://civicrm.org',
+ 'website_type_id' => '',
+ ),
+ ),
+ ),
+ '1' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 2,
+ 'values' => array(
'0' => array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
- '0' => array(
- 'id' => '1',
- 'contact_id' => '1',
- 'url' => 'http://civicrm.org',
- 'website_type_id' => '',
- ),
- ),
- ),
- '1' => array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 2,
- 'values' => array(
- '0' => array(
- 'id' => '2',
- 'contact_id' => '1',
- 'url' => 'http://chained.org',
- 'website_type_id' => '2',
- ),
- ),
- ),
+ 'id' => '2',
+ 'contact_id' => '1',
+ 'url' => 'http://chained.org',
+ 'website_type_id' => '2',
+ ),
),
+ ),
),
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreateIndividualWithContributionChainedArrays and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreateIndividualWithContributionChainedArrays
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using contact create API
- * /*this demonstrates setting a custom field through the API *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function contact_create_example(){
-$params = array(
- 'first_name' => 'abc1',
- 'contact_type' => 'Individual',
- 'last_name' => 'xyz1',
- 'custom_1' => 'custom string',
-);
-try{
- $result = civicrm_api3('contact', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using contact create API.
+ *
+ * /*this demonstrates setting a custom field through the API
+ *
+ * @return array
+ * API result array
+ */
+function contact_create_example() {
+ $params = array(
+ 'first_name' => 'abc1',
+ 'contact_type' => 'Individual',
+ 'last_name' => 'xyz1',
+ 'custom_1' => 'custom string',
+ );
-return $result;
+ try{
+ $result = civicrm_api3('contact', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function contact_create_expectedresult(){
+function contact_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'contact_type' => 'Individual',
- 'contact_sub_type' => '',
- 'do_not_email' => 0,
- 'do_not_phone' => 0,
- 'do_not_mail' => 0,
- 'do_not_sms' => 0,
- 'do_not_trade' => 0,
- 'is_opt_out' => 0,
- 'legal_identifier' => '',
- 'external_identifier' => '',
- 'sort_name' => 'xyz1, abc1',
- 'display_name' => 'abc1 xyz1',
- 'nick_name' => '',
- 'legal_name' => '',
- 'image_URL' => '',
- 'preferred_communication_method' => '',
- 'preferred_language' => 'en_US',
- 'preferred_mail_format' => 'Both',
- 'hash' => '67eac7789eaee00',
- 'api_key' => '',
- 'first_name' => 'abc1',
- 'middle_name' => '',
- 'last_name' => 'xyz1',
- 'prefix_id' => '',
- 'suffix_id' => '',
- 'formal_title' => '',
- 'communication_style_id' => '',
- 'email_greeting_id' => '1',
- 'email_greeting_custom' => '',
- 'email_greeting_display' => '',
- 'postal_greeting_id' => '1',
- 'postal_greeting_custom' => '',
- 'postal_greeting_display' => '',
- 'addressee_id' => '1',
- 'addressee_custom' => '',
- 'addressee_display' => '',
- 'job_title' => '',
- 'gender_id' => '',
- 'birth_date' => '',
- 'is_deceased' => 0,
- 'deceased_date' => '',
- 'household_name' => '',
- 'primary_contact_id' => '',
- 'organization_name' => '',
- 'sic_code' => '',
- 'user_unique_id' => '',
- 'created_date' => '2013-07-28 08:49:19',
- 'modified_date' => '2012-11-14 16:02:35',
- ),
+ 'id' => '1',
+ 'contact_type' => 'Individual',
+ 'contact_sub_type' => '',
+ 'do_not_email' => 0,
+ 'do_not_phone' => 0,
+ 'do_not_mail' => 0,
+ 'do_not_sms' => 0,
+ 'do_not_trade' => 0,
+ 'is_opt_out' => 0,
+ 'legal_identifier' => '',
+ 'external_identifier' => '',
+ 'sort_name' => 'xyz1, abc1',
+ 'display_name' => 'abc1 xyz1',
+ 'nick_name' => '',
+ 'legal_name' => '',
+ 'image_URL' => '',
+ 'preferred_communication_method' => '',
+ 'preferred_language' => 'en_US',
+ 'preferred_mail_format' => 'Both',
+ 'hash' => '67eac7789eaee00',
+ 'api_key' => '',
+ 'first_name' => 'abc1',
+ 'middle_name' => '',
+ 'last_name' => 'xyz1',
+ 'prefix_id' => '',
+ 'suffix_id' => '',
+ 'formal_title' => '',
+ 'communication_style_id' => '',
+ 'email_greeting_id' => '1',
+ 'email_greeting_custom' => '',
+ 'email_greeting_display' => '',
+ 'postal_greeting_id' => '1',
+ 'postal_greeting_custom' => '',
+ 'postal_greeting_display' => '',
+ 'addressee_id' => '1',
+ 'addressee_custom' => '',
+ 'addressee_display' => '',
+ 'job_title' => '',
+ 'gender_id' => '',
+ 'birth_date' => '',
+ 'is_deceased' => 0,
+ 'deceased_date' => '',
+ 'household_name' => '',
+ 'primary_contact_id' => '',
+ 'organization_name' => '',
+ 'sic_code' => '',
+ 'user_unique_id' => '',
+ 'created_date' => '2013-07-28 08:49:19',
+ 'modified_date' => '2012-11-14 16:02:35',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreateWithCustom and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreateWithCustom
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using contact get API
- * /*this demonstrates setting a custom field through the API *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function contact_get_example(){
-$params = array(
- 'return.custom_1' => 1,
- 'id' => 1,
-);
-try{
- $result = civicrm_api3('contact', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using contact get API.
+ *
+ * /*this demonstrates setting a custom field through the API
+ *
+ * @return array
+ * API result array
+ */
+function contact_get_example() {
+ $params = array(
+ 'return.custom_1' => 1,
+ 'id' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('contact', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function contact_get_expectedresult(){
+function contact_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'contact_id' => '1',
- 'civicrm_value_testgetwithcu_1_id' => '1',
- 'custom_1' => 'custom string',
- 'id' => '1',
- ),
+ 'contact_id' => '1',
+ 'civicrm_value_testgetwithcu_1_id' => '1',
+ 'custom_1' => 'custom string',
+ 'id' => '1',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetWithCustom and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetWithCustom
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using contact get API
- * /*this demonstrates setting a custom field through the API *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function contact_get_example(){
-$params = array(
- 'return' => 'custom_1',
- 'id' => 1,
-);
-try{
- $result = civicrm_api3('contact', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using contact get API.
+ *
+ * /*this demonstrates setting a custom field through the API
+ *
+ * @return array
+ * API result array
+ */
+function contact_get_example() {
+ $params = array(
+ 'return' => 'custom_1',
+ 'id' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('contact', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function contact_get_expectedresult(){
+function contact_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'contact_id' => '1',
- 'civicrm_value_testgetwithcu_1_id' => '1',
- 'custom_1' => 'custom string',
- 'id' => '1',
- ),
+ 'contact_id' => '1',
+ 'civicrm_value_testgetwithcu_1_id' => '1',
+ 'custom_1' => 'custom string',
+ 'id' => '1',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetWithCustomReturnSyntax and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetWithCustomReturnSyntax
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using contact delete API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function contact_delete_example(){
-$params = array(
- 'id' => 1,
-);
-try{
- $result = civicrm_api3('contact', 'delete', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using contact delete API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function contact_delete_example() {
+ $params = array(
+ 'id' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('contact', 'delete', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function contact_delete_expectedresult(){
+function contact_delete_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'values' => 1,
-);
+ '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
-*
-* testContactDelete and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testContactDelete
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using contact create API
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
+ */
+
+/**
+ * Test Generated example of using contact create API.
+ *
* This demonstrates use of the 'format.is_success' param.
- This param causes only the success or otherwise of the function to be returned as BOOLEAN *
+ This param causes only the success or otherwise of the function to be returned as BOOLEAN
+ *
+ * @return array
+ * API result array
*/
-function contact_create_example(){
-$params = array(
- 'id' => 500,
- 'format.is_success' => 1,
-);
+function contact_create_example() {
+ $params = array(
+ 'id' => 500,
+ 'format.is_success' => 1,
+ );
-try{
- $result = civicrm_api3('contact', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+ try{
+ $result = civicrm_api3('contact', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
-return $result;
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function contact_create_expectedresult(){
+function contact_create_expectedresult() {
$expectedResult = 0;
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testContactCreateFormatIsSuccessFalse and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testContactCreateFormatIsSuccessFalse
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using contact get API
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
+ */
+
+/**
+ * Test Generated example of using contact get API.
+ *
* This demonstrates use of the 'format.is_success' param.
- This param causes only the success or otherwise of the function to be returned as BOOLEAN *
+ This param causes only the success or otherwise of the function to be returned as BOOLEAN
+ *
+ * @return array
+ * API result array
*/
-function contact_get_example(){
-$params = array(
- 'id' => 17,
- 'format.is_success' => 1,
-);
+function contact_get_example() {
+ $params = array(
+ 'id' => 17,
+ 'format.is_success' => 1,
+ );
-try{
- $result = civicrm_api3('contact', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+ try{
+ $result = civicrm_api3('contact', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
-return $result;
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function contact_get_expectedresult(){
+function contact_get_expectedresult() {
$expectedResult = 1;
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testContactGetFormatIsSuccessTrue and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testContactGetFormatIsSuccessTrue
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using contact get API
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
+ */
+
+/**
+ * Test Generated example of using contact get API.
+ *
* This demonstrates use of the 'format.id_only' param.
/* This param causes the id of the only entity to be returned as an integer.
- /* it will be ignored if there is not exactly 1 result *
+ /* it will be ignored if there is not exactly 1 result
+ *
+ * @return array
+ * API result array
*/
-function contact_get_example(){
-$params = array(
- 'id' => 17,
- 'format.only_id' => 1,
-);
+function contact_get_example() {
+ $params = array(
+ 'id' => 17,
+ 'format.only_id' => 1,
+ );
-try{
- $result = civicrm_api3('contact', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+ try{
+ $result = civicrm_api3('contact', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
-return $result;
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function contact_get_expectedresult(){
+function contact_get_expectedresult() {
$expectedResult = 17;
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testContactGetFormatID_only and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testContactGetFormatID_only
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using contact getvalue API
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
+ */
+
+/**
+ * Test Generated example of using contact getvalue API.
+ *
* This demonstrates use of the 'format.single_value' param.
/* This param causes only a single value of the only entity to be returned as an string.
- /* it will be ignored if there is not exactly 1 result *
+ /* it will be ignored if there is not exactly 1 result
+ *
+ * @return array
+ * API result array
*/
-function contact_getvalue_example(){
-$params = array(
- 'id' => 17,
- 'return' => 'display_name',
-);
+function contact_getvalue_example() {
+ $params = array(
+ 'id' => 17,
+ 'return' => 'display_name',
+ );
-try{
- $result = civicrm_api3('contact', 'getvalue', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+ try{
+ $result = civicrm_api3('contact', 'getvalue', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
-return $result;
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function contact_getvalue_expectedresult(){
+function contact_getvalue_expectedresult() {
$expectedResult = 'Test Contact';
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testContactGetFormatSingleValue and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testContactGetFormatSingleValue
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using contact get API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function contact_get_example(){
-$params = array(
- 'email' => 'man2@yahoo.com',
-);
-try{
- $result = civicrm_api3('contact', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using contact get API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function contact_get_example() {
+ $params = array(
+ 'email' => 'man2@yahoo.com',
+ );
-return $result;
+ try{
+ $result = civicrm_api3('contact', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function contact_get_expectedresult(){
+function contact_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'contact_id' => '1',
- 'contact_type' => 'Individual',
- 'contact_sub_type' => '',
- 'sort_name' => 'man2@yahoo.com',
- 'display_name' => 'man2@yahoo.com',
- 'do_not_email' => 0,
- 'do_not_phone' => 0,
- 'do_not_mail' => 0,
- 'do_not_sms' => 0,
- 'do_not_trade' => 0,
- 'is_opt_out' => 0,
- 'legal_identifier' => '',
- 'external_identifier' => '',
- 'nick_name' => '',
- 'legal_name' => '',
- 'image_URL' => '',
- 'preferred_communication_method' => '',
- 'preferred_language' => 'en_US',
- 'preferred_mail_format' => 'Both',
- 'first_name' => '',
- 'middle_name' => '',
- 'last_name' => '',
- 'prefix_id' => '',
- 'suffix_id' => '',
- 'formal_title' => '',
- 'communication_style_id' => '',
- 'job_title' => '',
- 'gender_id' => '',
- 'birth_date' => '',
- 'is_deceased' => 0,
- 'deceased_date' => '',
- 'household_name' => '',
- 'organization_name' => '',
- 'sic_code' => '',
- 'contact_is_deleted' => 0,
- 'current_employer' => '',
- 'address_id' => '2',
- 'street_address' => '1 my road',
- 'supplemental_address_1' => '',
- 'supplemental_address_2' => '',
- 'city' => '',
- 'postal_code_suffix' => '',
- 'postal_code' => '',
- 'geo_code_1' => '',
- 'geo_code_2' => '',
- 'state_province_id' => '',
- 'country_id' => '',
- 'phone_id' => '',
- 'phone_type_id' => '',
- 'phone' => '',
- 'email_id' => '1',
- 'email' => 'man2@yahoo.com',
- 'on_hold' => 0,
- 'im_id' => '',
- 'provider_id' => '',
- 'im' => '',
- 'worldregion_id' => '',
- 'world_region' => '',
- 'individual_prefix' => '',
- 'individual_suffix' => '',
- 'communication_style' => '',
- 'gender' => '',
- 'state_province_name' => '',
- 'state_province' => '',
- 'country' => '',
- 'id' => '1',
- ),
+ 'contact_id' => '1',
+ 'contact_type' => 'Individual',
+ 'contact_sub_type' => '',
+ 'sort_name' => 'man2@yahoo.com',
+ 'display_name' => 'man2@yahoo.com',
+ 'do_not_email' => 0,
+ 'do_not_phone' => 0,
+ 'do_not_mail' => 0,
+ 'do_not_sms' => 0,
+ 'do_not_trade' => 0,
+ 'is_opt_out' => 0,
+ 'legal_identifier' => '',
+ 'external_identifier' => '',
+ 'nick_name' => '',
+ 'legal_name' => '',
+ 'image_URL' => '',
+ 'preferred_communication_method' => '',
+ 'preferred_language' => 'en_US',
+ 'preferred_mail_format' => 'Both',
+ 'first_name' => '',
+ 'middle_name' => '',
+ 'last_name' => '',
+ 'prefix_id' => '',
+ 'suffix_id' => '',
+ 'formal_title' => '',
+ 'communication_style_id' => '',
+ 'job_title' => '',
+ 'gender_id' => '',
+ 'birth_date' => '',
+ 'is_deceased' => 0,
+ 'deceased_date' => '',
+ 'household_name' => '',
+ 'organization_name' => '',
+ 'sic_code' => '',
+ 'contact_is_deleted' => 0,
+ 'current_employer' => '',
+ 'address_id' => '2',
+ 'street_address' => '1 my road',
+ 'supplemental_address_1' => '',
+ 'supplemental_address_2' => '',
+ 'city' => '',
+ 'postal_code_suffix' => '',
+ 'postal_code' => '',
+ 'geo_code_1' => '',
+ 'geo_code_2' => '',
+ 'state_province_id' => '',
+ 'country_id' => '',
+ 'phone_id' => '',
+ 'phone_type_id' => '',
+ 'phone' => '',
+ 'email_id' => '1',
+ 'email' => 'man2@yahoo.com',
+ 'on_hold' => 0,
+ 'im_id' => '',
+ 'provider_id' => '',
+ 'im' => '',
+ 'worldregion_id' => '',
+ 'world_region' => '',
+ 'individual_prefix' => '',
+ 'individual_suffix' => '',
+ 'communication_style' => '',
+ 'gender' => '',
+ 'state_province_name' => '',
+ 'state_province' => '',
+ 'country' => '',
+ 'id' => '1',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testContactGetEmail and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testContactGetEmail
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using contact getactions API
- * Getting the available actions for an entity. *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function contact_getactions_example(){
-$params = array();
-try{
- $result = civicrm_api3('contact', 'getactions', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using contact getactions API.
+ *
+ * Getting the available actions for an entity.
+ *
+ * @return array
+ * API result array
+ */
+function contact_getactions_example() {
+ $params = array();
-return $result;
+ try{
+ $result = civicrm_api3('contact', 'getactions', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function contact_getactions_expectedresult(){
+function contact_getactions_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 17,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 22,
+ 'values' => array(
'0' => 'create',
'1' => 'delete',
- '2' => 'get',
- '3' => 'getactions',
- '4' => 'getcount',
- '5' => 'getfields',
- '6' => 'getlist',
- '7' => 'getoptions',
- '8' => 'getquick',
- '9' => 'getrefcount',
- '10' => 'getsingle',
- '11' => 'getvalue',
- '12' => 'merge',
- '13' => 'proximity',
- '14' => 'replace',
- '15' => 'setvalue',
- '16' => 'update',
+ '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' => 'getvalue',
+ '14' => 'merge',
+ '15' => 'proximity',
+ '16' => 'replace',
+ '17' => 'setvalue',
+ '18' => 'type_create',
+ '19' => 'type_delete',
+ '20' => 'type_get',
+ '21' => 'update',
),
- 'deprecated' => array(
+ 'deprecated' => array(
'getquick' => 'The "getquick" action is deprecated in favor of "getlist".',
'update' => 'The "update" action is deprecated. Use "create" with an id instead.',
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetActions and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetActions
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using contact get API
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
+ */
+
+/**
+ * Test Generated example of using contact get API.
+ *
* /*This demonstrates use of the 'getCount' action
- /* This param causes the count of the only function to be returned as an integer *
+ /* This param causes the count of the only function to be returned as an integer
+ *
+ * @return array
+ * API result array
*/
-function contact_get_example(){
-$params = array(
- 'id' => 17,
-);
+function contact_get_example() {
+ $params = array(
+ 'id' => 17,
+ );
-try{
- $result = civicrm_api3('contact', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+ try{
+ $result = civicrm_api3('contact', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
-return $result;
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function contact_get_expectedresult(){
+function contact_get_expectedresult() {
$expectedResult = 1;
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testContactGetFormatcount_only and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testContactGetFormatcount_only
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using contact GetFields API
- * Demonstrate retrieving metadata with custom field options *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function contact_getfields_example(){
-$params = array(
- 'options' => array(
+
+/**
+ * Test Generated example of using contact GetFields API.
+ *
+ * Demonstrate retrieving metadata with custom field options
+ *
+ * @return array
+ * API result array
+ */
+function contact_getfields_example() {
+ $params = array(
+ 'options' => array(
'get_options' => 'custom_1',
),
- 'action' => 'create',
-);
+ 'action' => 'create',
+ );
-try{
- $result = civicrm_api3('contact', 'GetFields', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+ try{
+ $result = civicrm_api3('contact', 'GetFields', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
-return $result;
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function contact_getfields_expectedresult(){
+function contact_getfields_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 55,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 55,
+ 'values' => array(
'id' => array(
- 'name' => 'id',
- 'type' => 1,
- 'title' => 'Internal Contact ID',
- 'required' => true,
- 'import' => true,
- 'where' => 'civicrm_contact.id',
- 'headerPattern' => '/internal|contact?|id$/i',
- 'export' => true,
- 'api.aliases' => array(
- '0' => 'contact_id',
- ),
- ),
+ 'name' => 'id',
+ 'type' => 1,
+ 'title' => 'Internal Contact ID',
+ 'required' => TRUE,
+ 'import' => TRUE,
+ 'where' => 'civicrm_contact.id',
+ 'headerPattern' => '/internal|contact?|id$/i',
+ 'export' => TRUE,
+ 'api.aliases' => array(
+ '0' => 'contact_id',
+ ),
+ ),
'contact_type' => array(
- 'name' => 'contact_type',
- 'type' => 2,
- 'title' => 'Contact Type',
- 'maxlength' => 64,
- 'size' => 30,
- 'export' => true,
- 'where' => 'civicrm_contact.contact_type',
- 'html' => array(
- 'type' => 'Select',
- ),
- 'pseudoconstant' => array(
- 'table' => 'civicrm_contact_type',
- 'keyColumn' => 'name',
- 'labelColumn' => 'label',
- 'condition' => 'parent_id IS NULL',
- ),
- 'api.required' => 1,
- ),
+ 'name' => 'contact_type',
+ 'type' => 2,
+ 'title' => 'Contact Type',
+ 'maxlength' => 64,
+ 'size' => 30,
+ 'export' => TRUE,
+ 'where' => 'civicrm_contact.contact_type',
+ 'html' => array(
+ 'type' => 'Select',
+ ),
+ 'pseudoconstant' => array(
+ 'table' => 'civicrm_contact_type',
+ 'keyColumn' => 'name',
+ 'labelColumn' => 'label',
+ 'condition' => 'parent_id IS NULL',
+ ),
+ 'api.required' => 1,
+ ),
'contact_sub_type' => array(
- 'name' => 'contact_sub_type',
- 'type' => 2,
- 'title' => 'Contact Subtype',
- 'maxlength' => 255,
- 'size' => 45,
- 'import' => true,
- 'where' => 'civicrm_contact.contact_sub_type',
- 'headerPattern' => '/C(ontact )?(subtype|sub-type|sub type)/i',
- 'export' => true,
- 'html' => array(
- 'type' => 'Multi-Select',
- ),
- 'pseudoconstant' => array(
- 'table' => 'civicrm_contact_type',
- 'keyColumn' => 'name',
- 'labelColumn' => 'label',
- 'condition' => 'parent_id IS NOT NULL',
- ),
- ),
+ 'name' => 'contact_sub_type',
+ 'type' => 2,
+ 'title' => 'Contact Subtype',
+ 'maxlength' => 255,
+ 'size' => 45,
+ 'import' => TRUE,
+ 'where' => 'civicrm_contact.contact_sub_type',
+ 'headerPattern' => '/C(ontact )?(subtype|sub-type|sub type)/i',
+ 'export' => TRUE,
+ 'html' => array(
+ 'type' => 'Multi-Select',
+ ),
+ 'pseudoconstant' => array(
+ 'table' => 'civicrm_contact_type',
+ 'keyColumn' => 'name',
+ 'labelColumn' => 'label',
+ 'condition' => 'parent_id IS NOT NULL',
+ ),
+ ),
'do_not_email' => array(
- 'name' => 'do_not_email',
- 'type' => 16,
- 'title' => 'Do Not Email',
- 'import' => true,
- 'where' => 'civicrm_contact.do_not_email',
- 'headerPattern' => '/d(o )?(not )?(email)/i',
- 'dataPattern' => '/^\\d{1,}$/',
- 'export' => true,
- 'html' => array(
- 'type' => 'CheckBox',
- ),
- ),
+ 'name' => 'do_not_email',
+ 'type' => 16,
+ 'title' => 'Do Not Email',
+ 'import' => TRUE,
+ 'where' => 'civicrm_contact.do_not_email',
+ 'headerPattern' => '/d(o )?(not )?(email)/i',
+ 'dataPattern' => '/^\\d{1,}$/',
+ 'export' => TRUE,
+ 'html' => array(
+ 'type' => 'CheckBox',
+ ),
+ ),
'do_not_phone' => array(
- 'name' => 'do_not_phone',
- 'type' => 16,
- 'title' => 'Do Not Phone',
- 'import' => true,
- 'where' => 'civicrm_contact.do_not_phone',
- 'headerPattern' => '/d(o )?(not )?(call|phone)/i',
- 'dataPattern' => '/^\\d{1,}$/',
- 'export' => true,
- 'html' => array(
- 'type' => 'CheckBox',
- ),
- ),
+ 'name' => 'do_not_phone',
+ 'type' => 16,
+ 'title' => 'Do Not Phone',
+ 'import' => TRUE,
+ 'where' => 'civicrm_contact.do_not_phone',
+ 'headerPattern' => '/d(o )?(not )?(call|phone)/i',
+ 'dataPattern' => '/^\\d{1,}$/',
+ 'export' => TRUE,
+ 'html' => array(
+ 'type' => 'CheckBox',
+ ),
+ ),
'do_not_mail' => array(
- 'name' => 'do_not_mail',
- 'type' => 16,
- 'title' => 'Do Not Mail',
- 'import' => true,
- 'where' => 'civicrm_contact.do_not_mail',
- 'headerPattern' => '/^(d(o\\s)?n(ot\\s)?mail)|(\\w*)?bulk\\s?(\\w*)$/i',
- 'dataPattern' => '/^\\d{1,}$/',
- 'export' => true,
- 'html' => array(
- 'type' => 'CheckBox',
- ),
- ),
+ 'name' => 'do_not_mail',
+ 'type' => 16,
+ 'title' => 'Do Not Mail',
+ 'import' => TRUE,
+ 'where' => 'civicrm_contact.do_not_mail',
+ 'headerPattern' => '/^(d(o\\s)?n(ot\\s)?mail)|(\\w*)?bulk\\s?(\\w*)$/i',
+ 'dataPattern' => '/^\\d{1,}$/',
+ 'export' => TRUE,
+ 'html' => array(
+ 'type' => 'CheckBox',
+ ),
+ ),
'do_not_sms' => array(
- 'name' => 'do_not_sms',
- 'type' => 16,
- 'title' => 'Do Not Sms',
- 'import' => true,
- 'where' => 'civicrm_contact.do_not_sms',
- 'headerPattern' => '/d(o )?(not )?(sms)/i',
- 'dataPattern' => '/^\\d{1,}$/',
- 'export' => true,
- 'html' => array(
- 'type' => 'CheckBox',
- ),
- ),
+ 'name' => 'do_not_sms',
+ 'type' => 16,
+ 'title' => 'Do Not Sms',
+ 'import' => TRUE,
+ 'where' => 'civicrm_contact.do_not_sms',
+ 'headerPattern' => '/d(o )?(not )?(sms)/i',
+ 'dataPattern' => '/^\\d{1,}$/',
+ 'export' => TRUE,
+ 'html' => array(
+ 'type' => 'CheckBox',
+ ),
+ ),
'do_not_trade' => array(
- 'name' => 'do_not_trade',
- 'type' => 16,
- 'title' => 'Do Not Trade',
- 'import' => true,
- 'where' => 'civicrm_contact.do_not_trade',
- 'headerPattern' => '/d(o )?(not )?(trade)/i',
- 'dataPattern' => '/^\\d{1,}$/',
- 'export' => true,
- 'html' => array(
- 'type' => 'CheckBox',
- ),
- ),
+ 'name' => 'do_not_trade',
+ 'type' => 16,
+ 'title' => 'Do Not Trade',
+ 'import' => TRUE,
+ 'where' => 'civicrm_contact.do_not_trade',
+ 'headerPattern' => '/d(o )?(not )?(trade)/i',
+ 'dataPattern' => '/^\\d{1,}$/',
+ 'export' => TRUE,
+ 'html' => array(
+ 'type' => 'CheckBox',
+ ),
+ ),
'is_opt_out' => array(
- 'name' => 'is_opt_out',
- 'type' => 16,
- 'title' => 'No Bulk Emails (User Opt Out)',
- 'required' => true,
- 'import' => true,
- 'where' => 'civicrm_contact.is_opt_out',
- 'export' => true,
- 'html' => array(
- 'type' => 'CheckBox',
- ),
- ),
+ 'name' => 'is_opt_out',
+ 'type' => 16,
+ 'title' => 'No Bulk Emails (User Opt Out)',
+ 'required' => TRUE,
+ 'import' => TRUE,
+ 'where' => 'civicrm_contact.is_opt_out',
+ 'export' => TRUE,
+ 'html' => array(
+ 'type' => 'CheckBox',
+ ),
+ ),
'legal_identifier' => array(
- 'name' => 'legal_identifier',
- 'type' => 2,
- 'title' => 'Legal Identifier',
- 'maxlength' => 32,
- 'size' => 20,
- 'import' => true,
- 'where' => 'civicrm_contact.legal_identifier',
- 'headerPattern' => '/legal\\s?id/i',
- 'dataPattern' => '/\\w+?\\d{5,}/',
- 'export' => true,
- 'html' => array(
- 'type' => 'Text',
- ),
- ),
+ 'name' => 'legal_identifier',
+ 'type' => 2,
+ 'title' => 'Legal Identifier',
+ 'maxlength' => 32,
+ 'size' => 20,
+ 'import' => TRUE,
+ 'where' => 'civicrm_contact.legal_identifier',
+ 'headerPattern' => '/legal\\s?id/i',
+ 'dataPattern' => '/\\w+?\\d{5,}/',
+ 'export' => TRUE,
+ 'html' => array(
+ 'type' => 'Text',
+ ),
+ ),
'external_identifier' => array(
- 'name' => 'external_identifier',
- 'type' => 2,
- 'title' => 'External Identifier',
- 'maxlength' => 32,
- 'size' => 8,
- 'import' => true,
- 'where' => 'civicrm_contact.external_identifier',
- 'headerPattern' => '/external\\s?id/i',
- 'dataPattern' => '/^\\d{11,}$/',
- 'export' => true,
- 'html' => array(
- 'type' => 'Text',
- ),
- ),
+ 'name' => 'external_identifier',
+ 'type' => 2,
+ 'title' => 'External Identifier',
+ 'maxlength' => 32,
+ 'size' => 8,
+ 'import' => TRUE,
+ 'where' => 'civicrm_contact.external_identifier',
+ 'headerPattern' => '/external\\s?id/i',
+ 'dataPattern' => '/^\\d{11,}$/',
+ 'export' => TRUE,
+ 'html' => array(
+ 'type' => 'Text',
+ ),
+ ),
'sort_name' => array(
- 'name' => 'sort_name',
- 'type' => 2,
- 'title' => 'Sort Name',
- 'maxlength' => 128,
- 'size' => 30,
- 'export' => true,
- 'where' => 'civicrm_contact.sort_name',
- 'html' => array(
- 'type' => 'Text',
- ),
- ),
+ 'name' => 'sort_name',
+ 'type' => 2,
+ 'title' => 'Sort Name',
+ 'maxlength' => 128,
+ 'size' => 30,
+ 'export' => TRUE,
+ 'where' => 'civicrm_contact.sort_name',
+ 'html' => array(
+ 'type' => 'Text',
+ ),
+ ),
'display_name' => array(
- 'name' => 'display_name',
- 'type' => 2,
- 'title' => 'Display Name',
- 'maxlength' => 128,
- 'size' => 30,
- 'export' => true,
- 'where' => 'civicrm_contact.display_name',
- 'html' => array(
- 'type' => 'Text',
- ),
- ),
+ 'name' => 'display_name',
+ 'type' => 2,
+ 'title' => 'Display Name',
+ 'maxlength' => 128,
+ 'size' => 30,
+ 'export' => TRUE,
+ 'where' => 'civicrm_contact.display_name',
+ 'html' => array(
+ 'type' => 'Text',
+ ),
+ ),
'nick_name' => array(
- 'name' => 'nick_name',
- 'type' => 2,
- 'title' => 'Nickname',
- 'maxlength' => 128,
- 'size' => 30,
- 'import' => true,
- 'where' => 'civicrm_contact.nick_name',
- 'headerPattern' => '/n(ick\\s)name|nick$/i',
- 'dataPattern' => '/^\\w+$/',
- 'export' => true,
- 'html' => array(
- 'type' => 'Text',
- ),
- ),
+ 'name' => 'nick_name',
+ 'type' => 2,
+ 'title' => 'Nickname',
+ 'maxlength' => 128,
+ 'size' => 30,
+ 'import' => TRUE,
+ 'where' => 'civicrm_contact.nick_name',
+ 'headerPattern' => '/n(ick\\s)name|nick$/i',
+ 'dataPattern' => '/^\\w+$/',
+ 'export' => TRUE,
+ 'html' => array(
+ 'type' => 'Text',
+ ),
+ ),
'legal_name' => array(
- 'name' => 'legal_name',
- 'type' => 2,
- 'title' => 'Legal Name',
- 'maxlength' => 128,
- 'size' => 30,
- 'import' => true,
- 'where' => 'civicrm_contact.legal_name',
- 'headerPattern' => '/^legal|(l(egal\\s)?name)$/i',
- 'export' => true,
- 'html' => array(
- 'type' => 'Text',
- ),
- ),
+ 'name' => 'legal_name',
+ 'type' => 2,
+ 'title' => 'Legal Name',
+ 'maxlength' => 128,
+ 'size' => 30,
+ 'import' => TRUE,
+ 'where' => 'civicrm_contact.legal_name',
+ 'headerPattern' => '/^legal|(l(egal\\s)?name)$/i',
+ 'export' => TRUE,
+ 'html' => array(
+ 'type' => 'Text',
+ ),
+ ),
'image_URL' => array(
- 'name' => 'image_URL',
- 'type' => 2,
- 'title' => 'Image Url',
- 'maxlength' => 255,
- 'size' => 45,
- 'import' => true,
- 'where' => 'civicrm_contact.image_URL',
- 'export' => true,
- 'html' => array(
- 'type' => 'Text',
- ),
- ),
+ 'name' => 'image_URL',
+ 'type' => 2,
+ 'title' => 'Image Url',
+ 'maxlength' => 255,
+ 'size' => 45,
+ 'import' => TRUE,
+ 'where' => 'civicrm_contact.image_URL',
+ 'export' => TRUE,
+ 'html' => array(
+ 'type' => 'Text',
+ ),
+ ),
'preferred_communication_method' => array(
- 'name' => 'preferred_communication_method',
- 'type' => 2,
- 'title' => 'Preferred Communication Method',
- 'maxlength' => 255,
- 'size' => 45,
- 'import' => true,
- 'where' => 'civicrm_contact.preferred_communication_method',
- 'headerPattern' => '/^p(ref\\w*\\s)?c(omm\\w*)|( meth\\w*)$/i',
- 'dataPattern' => '/^\\w+$/',
- 'export' => true,
- 'html' => array(
- 'type' => 'Select',
- ),
- 'pseudoconstant' => array(
- 'optionGroupName' => 'preferred_communication_method',
- ),
- ),
+ 'name' => 'preferred_communication_method',
+ 'type' => 2,
+ 'title' => 'Preferred Communication Method',
+ 'maxlength' => 255,
+ 'size' => 45,
+ 'import' => TRUE,
+ 'where' => 'civicrm_contact.preferred_communication_method',
+ 'headerPattern' => '/^p(ref\\w*\\s)?c(omm\\w*)|( meth\\w*)$/i',
+ 'dataPattern' => '/^\\w+$/',
+ 'export' => TRUE,
+ 'html' => array(
+ 'type' => 'Select',
+ ),
+ 'pseudoconstant' => array(
+ 'optionGroupName' => 'preferred_communication_method',
+ ),
+ ),
'preferred_language' => array(
- 'name' => 'preferred_language',
- 'type' => 2,
- 'title' => 'Preferred Language',
- 'maxlength' => 5,
- 'size' => 6,
- 'import' => true,
- 'where' => 'civicrm_contact.preferred_language',
- 'headerPattern' => '/^lang/i',
- 'export' => true,
- 'html' => array(
- 'type' => 'Select',
- ),
- 'pseudoconstant' => array(
- 'optionGroupName' => 'languages',
- 'keyColumn' => 'name',
- ),
- ),
+ 'name' => 'preferred_language',
+ 'type' => 2,
+ 'title' => 'Preferred Language',
+ 'maxlength' => 5,
+ 'size' => 6,
+ 'import' => TRUE,
+ 'where' => 'civicrm_contact.preferred_language',
+ 'headerPattern' => '/^lang/i',
+ 'export' => TRUE,
+ 'html' => array(
+ 'type' => 'Select',
+ ),
+ 'pseudoconstant' => array(
+ 'optionGroupName' => 'languages',
+ 'keyColumn' => 'name',
+ ),
+ ),
'preferred_mail_format' => array(
- 'name' => 'preferred_mail_format',
- 'type' => 2,
- 'title' => 'Preferred Mail Format',
- 'maxlength' => 8,
- 'size' => 8,
- 'import' => true,
- 'where' => 'civicrm_contact.preferred_mail_format',
- 'headerPattern' => '/^p(ref\\w*\\s)?m(ail\\s)?f(orm\\w*)$/i',
- 'export' => true,
- 'default' => 'Both',
- 'html' => array(
- 'type' => 'Select',
- ),
- 'pseudoconstant' => array(
- 'callback' => 'CRM_Core_SelectValues::pmf',
- ),
- ),
+ 'name' => 'preferred_mail_format',
+ 'type' => 2,
+ 'title' => 'Preferred Mail Format',
+ 'maxlength' => 8,
+ 'size' => 8,
+ 'import' => TRUE,
+ 'where' => 'civicrm_contact.preferred_mail_format',
+ 'headerPattern' => '/^p(ref\\w*\\s)?m(ail\\s)?f(orm\\w*)$/i',
+ 'export' => TRUE,
+ 'default' => 'Both',
+ 'html' => array(
+ 'type' => 'Select',
+ ),
+ 'pseudoconstant' => array(
+ 'callback' => 'CRM_Core_SelectValues::pmf',
+ ),
+ ),
'hash' => array(
- 'name' => 'hash',
- 'type' => 2,
- 'title' => 'Contact Hash',
- 'maxlength' => 32,
- 'size' => 20,
- 'export' => true,
- 'where' => 'civicrm_contact.hash',
- ),
+ 'name' => 'hash',
+ 'type' => 2,
+ 'title' => 'Contact Hash',
+ 'maxlength' => 32,
+ 'size' => 20,
+ 'export' => TRUE,
+ 'where' => 'civicrm_contact.hash',
+ ),
'api_key' => array(
- 'name' => 'api_key',
- 'type' => 2,
- 'title' => 'Api Key',
- 'maxlength' => 32,
- 'size' => 20,
- ),
+ 'name' => 'api_key',
+ 'type' => 2,
+ 'title' => 'Api Key',
+ 'maxlength' => 32,
+ 'size' => 20,
+ ),
'first_name' => array(
- 'name' => 'first_name',
- 'type' => 2,
- 'title' => 'First Name',
- 'maxlength' => 64,
- 'size' => 30,
- 'import' => true,
- 'where' => 'civicrm_contact.first_name',
- 'headerPattern' => '/^first|(f(irst\\s)?name)$/i',
- 'dataPattern' => '/^\\w+$/',
- 'export' => true,
- 'html' => array(
- 'type' => 'Text',
- ),
- ),
+ 'name' => 'first_name',
+ 'type' => 2,
+ 'title' => 'First Name',
+ 'maxlength' => 64,
+ 'size' => 30,
+ 'import' => TRUE,
+ 'where' => 'civicrm_contact.first_name',
+ 'headerPattern' => '/^first|(f(irst\\s)?name)$/i',
+ 'dataPattern' => '/^\\w+$/',
+ 'export' => TRUE,
+ 'html' => array(
+ 'type' => 'Text',
+ ),
+ ),
'middle_name' => array(
- 'name' => 'middle_name',
- 'type' => 2,
- 'title' => 'Middle Name',
- 'maxlength' => 64,
- 'size' => 20,
- 'import' => true,
- 'where' => 'civicrm_contact.middle_name',
- 'headerPattern' => '/^middle|(m(iddle\\s)?name)$/i',
- 'dataPattern' => '/^\\w+$/',
- 'export' => true,
- 'html' => array(
- 'type' => 'Text',
- ),
- ),
+ 'name' => 'middle_name',
+ 'type' => 2,
+ 'title' => 'Middle Name',
+ 'maxlength' => 64,
+ 'size' => 20,
+ 'import' => TRUE,
+ 'where' => 'civicrm_contact.middle_name',
+ 'headerPattern' => '/^middle|(m(iddle\\s)?name)$/i',
+ 'dataPattern' => '/^\\w+$/',
+ 'export' => TRUE,
+ 'html' => array(
+ 'type' => 'Text',
+ ),
+ ),
'last_name' => array(
- 'name' => 'last_name',
- 'type' => 2,
- 'title' => 'Last Name',
- 'maxlength' => 64,
- 'size' => 30,
- 'import' => true,
- 'where' => 'civicrm_contact.last_name',
- 'headerPattern' => '/^last|(l(ast\\s)?name)$/i',
- 'dataPattern' => '/^\\w+(\\s\\w+)?+$/',
- 'export' => true,
- 'html' => array(
- 'type' => 'Text',
- ),
- ),
+ 'name' => 'last_name',
+ 'type' => 2,
+ 'title' => 'Last Name',
+ 'maxlength' => 64,
+ 'size' => 30,
+ 'import' => TRUE,
+ 'where' => 'civicrm_contact.last_name',
+ 'headerPattern' => '/^last|(l(ast\\s)?name)$/i',
+ 'dataPattern' => '/^\\w+(\\s\\w+)?+$/',
+ 'export' => TRUE,
+ 'html' => array(
+ 'type' => 'Text',
+ ),
+ ),
'prefix_id' => array(
- 'name' => 'prefix_id',
- 'type' => 1,
- 'title' => 'Individual Prefix',
- 'import' => true,
- 'where' => 'civicrm_contact.prefix_id',
- 'headerPattern' => '/^(prefix|title)/i',
- 'dataPattern' => '/^(mr|ms|mrs|sir|dr)\\.?$/i',
- 'export' => true,
- 'html' => array(
- 'type' => 'Select',
- ),
- 'pseudoconstant' => array(
- 'optionGroupName' => 'individual_prefix',
- ),
- 'api.aliases' => array(
- '0' => 'individual_prefix',
- '1' => 'individual_prefix_id',
- ),
- ),
+ 'name' => 'prefix_id',
+ 'type' => 1,
+ 'title' => 'Individual Prefix',
+ 'import' => TRUE,
+ 'where' => 'civicrm_contact.prefix_id',
+ 'headerPattern' => '/^(prefix|title)/i',
+ 'dataPattern' => '/^(mr|ms|mrs|sir|dr)\\.?$/i',
+ 'export' => TRUE,
+ 'html' => array(
+ 'type' => 'Select',
+ ),
+ 'pseudoconstant' => array(
+ 'optionGroupName' => 'individual_prefix',
+ ),
+ 'api.aliases' => array(
+ '0' => 'individual_prefix',
+ '1' => 'individual_prefix_id',
+ ),
+ ),
'suffix_id' => array(
- 'name' => 'suffix_id',
- 'type' => 1,
- 'title' => 'Individual Suffix',
- 'import' => true,
- 'where' => 'civicrm_contact.suffix_id',
- 'headerPattern' => '/^suffix$/i',
- 'dataPattern' => '/^(sr|jr)\\.?|i{2,}$/',
- 'export' => true,
- 'html' => array(
- 'type' => 'Select',
- ),
- 'pseudoconstant' => array(
- 'optionGroupName' => 'individual_suffix',
- ),
- 'api.aliases' => array(
- '0' => 'individual_suffix',
- '1' => 'individual_suffix_id',
- ),
- ),
+ 'name' => 'suffix_id',
+ 'type' => 1,
+ 'title' => 'Individual Suffix',
+ 'import' => TRUE,
+ 'where' => 'civicrm_contact.suffix_id',
+ 'headerPattern' => '/^suffix$/i',
+ 'dataPattern' => '/^(sr|jr)\\.?|i{2,}$/',
+ 'export' => TRUE,
+ 'html' => array(
+ 'type' => 'Select',
+ ),
+ 'pseudoconstant' => array(
+ 'optionGroupName' => 'individual_suffix',
+ ),
+ 'api.aliases' => array(
+ '0' => 'individual_suffix',
+ '1' => 'individual_suffix_id',
+ ),
+ ),
'formal_title' => array(
- 'name' => 'formal_title',
- 'type' => 2,
- 'title' => 'Formal Title',
- 'maxlength' => 64,
- 'size' => 30,
- 'import' => true,
- 'where' => 'civicrm_contact.formal_title',
- 'headerPattern' => '/^title/i',
- 'export' => true,
- ),
+ 'name' => 'formal_title',
+ 'type' => 2,
+ 'title' => 'Formal Title',
+ 'maxlength' => 64,
+ 'size' => 30,
+ 'import' => TRUE,
+ 'where' => 'civicrm_contact.formal_title',
+ 'headerPattern' => '/^title/i',
+ 'export' => TRUE,
+ ),
'communication_style_id' => array(
- 'name' => 'communication_style_id',
- 'type' => 1,
- 'title' => 'Communication Style',
- 'export' => true,
- 'where' => 'civicrm_contact.communication_style_id',
- 'pseudoconstant' => array(
- 'optionGroupName' => 'communication_style',
- ),
- ),
+ 'name' => 'communication_style_id',
+ 'type' => 1,
+ 'title' => 'Communication Style',
+ 'export' => TRUE,
+ 'where' => 'civicrm_contact.communication_style_id',
+ 'pseudoconstant' => array(
+ 'optionGroupName' => 'communication_style',
+ ),
+ ),
'email_greeting_id' => array(
- 'name' => 'email_greeting_id',
- 'type' => 1,
- 'title' => 'Email Greeting ID',
- ),
+ 'name' => 'email_greeting_id',
+ 'type' => 1,
+ 'title' => 'Email Greeting ID',
+ ),
'email_greeting_custom' => array(
- 'name' => 'email_greeting_custom',
- 'type' => 2,
- 'title' => 'Email Greeting Custom',
- 'maxlength' => 128,
- 'size' => 45,
- 'import' => true,
- 'where' => 'civicrm_contact.email_greeting_custom',
- 'html' => array(
- 'type' => 'Text',
- ),
- ),
+ 'name' => 'email_greeting_custom',
+ 'type' => 2,
+ 'title' => 'Email Greeting Custom',
+ 'maxlength' => 128,
+ 'size' => 45,
+ 'import' => TRUE,
+ 'where' => 'civicrm_contact.email_greeting_custom',
+ 'html' => array(
+ 'type' => 'Text',
+ ),
+ ),
'email_greeting_display' => array(
- 'name' => 'email_greeting_display',
- 'type' => 2,
- 'title' => 'Email Greeting',
- 'maxlength' => 255,
- 'size' => 45,
- 'html' => array(
- 'type' => 'Text',
- ),
- ),
+ 'name' => 'email_greeting_display',
+ 'type' => 2,
+ 'title' => 'Email Greeting',
+ 'maxlength' => 255,
+ 'size' => 45,
+ 'html' => array(
+ 'type' => 'Text',
+ ),
+ ),
'postal_greeting_id' => array(
- 'name' => 'postal_greeting_id',
- 'type' => 1,
- 'title' => 'Postal Greeting ID',
- 'html' => array(
- 'type' => 'Text',
- ),
+ 'name' => 'postal_greeting_id',
+ 'type' => 1,
+ 'title' => 'Postal Greeting ID',
+ 'html' => array(
+ 'type' => 'Text',
),
+ ),
'postal_greeting_custom' => array(
- 'name' => 'postal_greeting_custom',
- 'type' => 2,
- 'title' => 'Postal Greeting Custom',
- 'maxlength' => 128,
- 'size' => 45,
- 'import' => true,
- 'where' => 'civicrm_contact.postal_greeting_custom',
- 'html' => array(
- 'type' => 'Text',
- ),
- ),
+ 'name' => 'postal_greeting_custom',
+ 'type' => 2,
+ 'title' => 'Postal Greeting Custom',
+ 'maxlength' => 128,
+ 'size' => 45,
+ 'import' => TRUE,
+ 'where' => 'civicrm_contact.postal_greeting_custom',
+ 'html' => array(
+ 'type' => 'Text',
+ ),
+ ),
'postal_greeting_display' => array(
- 'name' => 'postal_greeting_display',
- 'type' => 2,
- 'title' => 'Postal Greeting',
- 'maxlength' => 255,
- 'size' => 45,
- 'html' => array(
- 'type' => 'Text',
- ),
- ),
+ 'name' => 'postal_greeting_display',
+ 'type' => 2,
+ 'title' => 'Postal Greeting',
+ 'maxlength' => 255,
+ 'size' => 45,
+ 'html' => array(
+ 'type' => 'Text',
+ ),
+ ),
'addressee_id' => array(
- 'name' => 'addressee_id',
- 'type' => 1,
- 'title' => 'Addressee ID',
- ),
+ 'name' => 'addressee_id',
+ 'type' => 1,
+ 'title' => 'Addressee ID',
+ ),
'addressee_custom' => array(
- 'name' => 'addressee_custom',
- 'type' => 2,
- 'title' => 'Addressee Custom',
- 'maxlength' => 128,
- 'size' => 45,
- 'import' => true,
- 'where' => 'civicrm_contact.addressee_custom',
- 'html' => array(
- 'type' => 'Text',
- ),
- ),
+ 'name' => 'addressee_custom',
+ 'type' => 2,
+ 'title' => 'Addressee Custom',
+ 'maxlength' => 128,
+ 'size' => 45,
+ 'import' => TRUE,
+ 'where' => 'civicrm_contact.addressee_custom',
+ 'html' => array(
+ 'type' => 'Text',
+ ),
+ ),
'addressee_display' => array(
- 'name' => 'addressee_display',
- 'type' => 2,
- 'title' => 'Addressee',
- 'maxlength' => 255,
- 'size' => 45,
- 'html' => array(
- 'type' => 'Text',
- ),
- ),
+ 'name' => 'addressee_display',
+ 'type' => 2,
+ 'title' => 'Addressee',
+ 'maxlength' => 255,
+ 'size' => 45,
+ 'html' => array(
+ 'type' => 'Text',
+ ),
+ ),
'job_title' => array(
- 'name' => 'job_title',
- 'type' => 2,
- 'title' => 'Job Title',
- 'maxlength' => 255,
- 'size' => 20,
- 'import' => true,
- 'where' => 'civicrm_contact.job_title',
- 'headerPattern' => '/^job|(j(ob\\s)?title)$/i',
- 'dataPattern' => '//',
- 'export' => true,
- 'html' => array(
- 'type' => 'Text',
- ),
- ),
+ 'name' => 'job_title',
+ 'type' => 2,
+ 'title' => 'Job Title',
+ 'maxlength' => 255,
+ 'size' => 20,
+ 'import' => TRUE,
+ 'where' => 'civicrm_contact.job_title',
+ 'headerPattern' => '/^job|(j(ob\\s)?title)$/i',
+ 'dataPattern' => '//',
+ 'export' => TRUE,
+ 'html' => array(
+ 'type' => 'Text',
+ ),
+ ),
'gender_id' => array(
- 'name' => 'gender_id',
- 'type' => 1,
- 'title' => 'Gender',
- 'import' => true,
- 'where' => 'civicrm_contact.gender_id',
- 'headerPattern' => '/^gender$/i',
- 'export' => true,
- 'html' => array(
- 'type' => 'Select',
- ),
- 'pseudoconstant' => array(
- 'optionGroupName' => 'gender',
- ),
- ),
+ 'name' => 'gender_id',
+ 'type' => 1,
+ 'title' => 'Gender',
+ 'import' => TRUE,
+ 'where' => 'civicrm_contact.gender_id',
+ 'headerPattern' => '/^gender$/i',
+ 'export' => TRUE,
+ 'html' => array(
+ 'type' => 'Select',
+ ),
+ 'pseudoconstant' => array(
+ 'optionGroupName' => 'gender',
+ ),
+ ),
'birth_date' => array(
- 'name' => 'birth_date',
- 'type' => 4,
- 'title' => 'Birth Date',
- 'import' => true,
- 'where' => 'civicrm_contact.birth_date',
- 'headerPattern' => '/^birth|(b(irth\\s)?date)|D(\\W*)O(\\W*)B(\\W*)$/i',
- 'dataPattern' => '/\\d{4}-?\\d{2}-?\\d{2}/',
- 'export' => true,
- 'html' => array(
- 'type' => 'Select Date',
- ),
- ),
+ 'name' => 'birth_date',
+ 'type' => 4,
+ 'title' => 'Birth Date',
+ 'import' => TRUE,
+ 'where' => 'civicrm_contact.birth_date',
+ 'headerPattern' => '/^birth|(b(irth\\s)?date)|D(\\W*)O(\\W*)B(\\W*)$/i',
+ 'dataPattern' => '/\\d{4}-?\\d{2}-?\\d{2}/',
+ 'export' => TRUE,
+ 'html' => array(
+ 'type' => 'Select Date',
+ ),
+ ),
'is_deceased' => array(
- 'name' => 'is_deceased',
- 'type' => 16,
- 'title' => 'Is Deceased',
- 'import' => true,
- 'where' => 'civicrm_contact.is_deceased',
- 'headerPattern' => '/i(s\\s)?d(eceased)$/i',
- 'export' => true,
- 'html' => array(
- 'type' => 'CheckBox',
- ),
- ),
+ 'name' => 'is_deceased',
+ 'type' => 16,
+ 'title' => 'Is Deceased',
+ 'import' => TRUE,
+ 'where' => 'civicrm_contact.is_deceased',
+ 'headerPattern' => '/i(s\\s)?d(eceased)$/i',
+ 'export' => TRUE,
+ 'html' => array(
+ 'type' => 'CheckBox',
+ ),
+ ),
'deceased_date' => array(
- 'name' => 'deceased_date',
- 'type' => 4,
- 'title' => 'Deceased Date',
- 'import' => true,
- 'where' => 'civicrm_contact.deceased_date',
- 'headerPattern' => '/^deceased|(d(eceased\\s)?date)$/i',
- 'export' => true,
- 'html' => array(
- 'type' => 'Select Date',
- ),
- ),
+ 'name' => 'deceased_date',
+ 'type' => 4,
+ 'title' => 'Deceased Date',
+ 'import' => TRUE,
+ 'where' => 'civicrm_contact.deceased_date',
+ 'headerPattern' => '/^deceased|(d(eceased\\s)?date)$/i',
+ 'export' => TRUE,
+ 'html' => array(
+ 'type' => 'Select Date',
+ ),
+ ),
'household_name' => array(
- 'name' => 'household_name',
- 'type' => 2,
- 'title' => 'Household Name',
- 'maxlength' => 128,
- 'size' => 30,
- 'import' => true,
- 'where' => 'civicrm_contact.household_name',
- 'headerPattern' => '/^household|(h(ousehold\\s)?name)$/i',
- 'dataPattern' => '/^\\w+$/',
- 'export' => true,
- 'html' => array(
- 'type' => 'Text',
- ),
- ),
+ 'name' => 'household_name',
+ 'type' => 2,
+ 'title' => 'Household Name',
+ 'maxlength' => 128,
+ 'size' => 30,
+ 'import' => TRUE,
+ 'where' => 'civicrm_contact.household_name',
+ 'headerPattern' => '/^household|(h(ousehold\\s)?name)$/i',
+ 'dataPattern' => '/^\\w+$/',
+ 'export' => TRUE,
+ 'html' => array(
+ 'type' => 'Text',
+ ),
+ ),
'primary_contact_id' => array(
- 'name' => 'primary_contact_id',
- 'type' => 1,
- 'title' => 'Household Primary Contact ID',
- 'FKClassName' => 'CRM_Contact_DAO_Contact',
- 'html' => array(
- 'type' => 'Select',
- ),
- ),
+ 'name' => 'primary_contact_id',
+ 'type' => 1,
+ 'title' => 'Household Primary Contact ID',
+ 'FKClassName' => 'CRM_Contact_DAO_Contact',
+ 'html' => array(
+ 'type' => 'Select',
+ ),
+ 'FKApiName' => 'Contact',
+ ),
'organization_name' => array(
- 'name' => 'organization_name',
- 'type' => 2,
- 'title' => 'Organization Name',
- 'maxlength' => 128,
- 'size' => 30,
- 'import' => true,
- 'where' => 'civicrm_contact.organization_name',
- 'headerPattern' => '/^organization|(o(rganization\\s)?name)$/i',
- 'dataPattern' => '/^\\w+$/',
- 'export' => true,
- 'html' => array(
- 'type' => 'Text',
- ),
- ),
+ 'name' => 'organization_name',
+ 'type' => 2,
+ 'title' => 'Organization Name',
+ 'maxlength' => 128,
+ 'size' => 30,
+ 'import' => TRUE,
+ 'where' => 'civicrm_contact.organization_name',
+ 'headerPattern' => '/^organization|(o(rganization\\s)?name)$/i',
+ 'dataPattern' => '/^\\w+$/',
+ 'export' => TRUE,
+ 'html' => array(
+ 'type' => 'Text',
+ ),
+ ),
'sic_code' => array(
- 'name' => 'sic_code',
- 'type' => 2,
- 'title' => 'Sic Code',
- 'maxlength' => 8,
- 'size' => 8,
- 'import' => true,
- 'where' => 'civicrm_contact.sic_code',
- 'headerPattern' => '/^sic|(s(ic\\s)?code)$/i',
- 'export' => true,
- 'html' => array(
- 'type' => 'Text',
- ),
- ),
+ 'name' => 'sic_code',
+ 'type' => 2,
+ 'title' => 'Sic Code',
+ 'maxlength' => 8,
+ 'size' => 8,
+ 'import' => TRUE,
+ 'where' => 'civicrm_contact.sic_code',
+ 'headerPattern' => '/^sic|(s(ic\\s)?code)$/i',
+ 'export' => TRUE,
+ 'html' => array(
+ 'type' => 'Text',
+ ),
+ ),
'user_unique_id' => array(
- 'name' => 'user_unique_id',
- 'type' => 2,
- 'title' => 'Unique ID (OpenID)',
- 'maxlength' => 255,
- 'size' => 45,
- 'import' => true,
- 'where' => 'civicrm_contact.user_unique_id',
- 'headerPattern' => '/^Open\\s?ID|u(niq\\w*)?\\s?ID/i',
- 'dataPattern' => '/^[\\w\\/\\:\\.]+$/',
- 'export' => true,
- 'rule' => 'url',
- 'html' => array(
- 'type' => 'Text',
- ),
- ),
+ 'name' => 'user_unique_id',
+ 'type' => 2,
+ 'title' => 'Unique ID (OpenID)',
+ 'maxlength' => 255,
+ 'size' => 45,
+ 'import' => TRUE,
+ 'where' => 'civicrm_contact.user_unique_id',
+ 'headerPattern' => '/^Open\\s?ID|u(niq\\w*)?\\s?ID/i',
+ 'dataPattern' => '/^[\\w\\/\\:\\.]+$/',
+ 'export' => TRUE,
+ 'rule' => 'url',
+ 'html' => array(
+ 'type' => 'Text',
+ ),
+ ),
'created_date' => array(
- 'name' => 'created_date',
- 'type' => 256,
- 'title' => 'Created Date',
- 'required' => '',
- 'export' => true,
- 'where' => 'civicrm_contact.created_date',
- 'default' => 'NULL',
- ),
+ 'name' => 'created_date',
+ 'type' => 256,
+ 'title' => 'Created Date',
+ 'required' => '',
+ 'export' => TRUE,
+ 'where' => 'civicrm_contact.created_date',
+ 'default' => 'NULL',
+ ),
'modified_date' => array(
- 'name' => 'modified_date',
- 'type' => 256,
- 'title' => 'Modified Date',
- 'required' => '',
- 'export' => true,
- 'where' => 'civicrm_contact.modified_date',
- 'default' => 'CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
- ),
+ 'name' => 'modified_date',
+ 'type' => 256,
+ 'title' => 'Modified Date',
+ 'required' => '',
+ 'export' => TRUE,
+ 'where' => 'civicrm_contact.modified_date',
+ 'default' => 'CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
+ ),
'source' => array(
- 'name' => 'source',
- 'type' => 2,
- 'title' => 'Source of Contact Data',
- 'maxlength' => 255,
- 'size' => 30,
- 'import' => true,
- 'where' => 'civicrm_contact.source',
- 'headerPattern' => '/(S(ource\\s)?o(f\\s)?C(ontact\\s)?Data)$/i',
- 'export' => true,
- 'html' => array(
- 'type' => 'Text',
- ),
- 'uniqueName' => 'contact_source',
- ),
+ 'name' => 'source',
+ 'type' => 2,
+ 'title' => 'Source of Contact Data',
+ 'maxlength' => 255,
+ 'size' => 30,
+ 'import' => TRUE,
+ 'where' => 'civicrm_contact.source',
+ 'headerPattern' => '/(S(ource\\s)?o(f\\s)?C(ontact\\s)?Data)$/i',
+ 'export' => TRUE,
+ 'html' => array(
+ 'type' => 'Text',
+ ),
+ 'uniqueName' => 'contact_source',
+ ),
'employer_id' => array(
- 'name' => 'employer_id',
- 'type' => 1,
- 'title' => 'Current Employer ID',
- 'export' => true,
- 'where' => 'civicrm_contact.employer_id',
- 'FKClassName' => 'CRM_Contact_DAO_Contact',
- 'html' => array(
- 'type' => 'Autocomplete-Select',
- ),
- 'uniqueName' => 'current_employer_id',
- ),
+ 'name' => 'employer_id',
+ 'type' => 1,
+ 'title' => 'Current Employer ID',
+ 'export' => TRUE,
+ 'where' => 'civicrm_contact.employer_id',
+ 'FKClassName' => 'CRM_Contact_DAO_Contact',
+ 'html' => array(
+ 'type' => 'Autocomplete-Select',
+ ),
+ 'uniqueName' => 'current_employer_id',
+ 'FKApiName' => 'Contact',
+ ),
'is_deleted' => array(
- 'name' => 'is_deleted',
- 'type' => 16,
- 'title' => 'Contact is in Trash',
- 'required' => true,
- 'export' => true,
- 'where' => 'civicrm_contact.is_deleted',
- 'html' => array(
- 'type' => 'CheckBox',
- ),
- 'uniqueName' => 'contact_is_deleted',
- ),
+ 'name' => 'is_deleted',
+ 'type' => 16,
+ 'title' => 'Contact is in Trash',
+ 'required' => TRUE,
+ 'export' => TRUE,
+ 'where' => 'civicrm_contact.is_deleted',
+ 'html' => array(
+ 'type' => 'CheckBox',
+ ),
+ 'uniqueName' => 'contact_is_deleted',
+ ),
'custom_1' => array(
- 'label' => 'Our special field',
- 'groupTitle' => 'select_test_g',
- 'data_type' => 'String',
- 'html_type' => 'Select',
- 'default_value' => '',
- 'text_length' => '',
- 'options_per_line' => '',
- 'custom_group_id' => '1',
- 'extends' => 'Contact',
- 'is_search_range' => 0,
- 'extends_entity_column_value' => '',
- 'extends_entity_column_id' => '',
- 'is_view' => 0,
- 'is_multiple' => 0,
- 'option_group_id' => '102',
- 'date_format' => '',
- 'time_format' => '',
- 'is_required' => '1',
- 'name' => 'custom_1',
- 'title' => 'Our special field',
- 'type' => 2,
- 'options' => array(
- '1' => 'Label1',
- '2' => 'Label2',
- ),
- ),
+ 'label' => 'Our special field',
+ 'groupTitle' => 'select_test_g',
+ 'data_type' => 'String',
+ 'html_type' => 'Select',
+ 'default_value' => '',
+ 'text_length' => '',
+ 'options_per_line' => '',
+ 'custom_group_id' => '1',
+ 'extends' => 'Contact',
+ 'is_search_range' => 0,
+ 'extends_entity_column_value' => '',
+ 'extends_entity_column_id' => '',
+ 'is_view' => 0,
+ 'is_multiple' => 0,
+ 'option_group_id' => '105',
+ 'date_format' => '',
+ 'time_format' => '',
+ 'is_required' => '1',
+ 'name' => 'custom_1',
+ 'title' => 'Our special field',
+ 'type' => 2,
+ 'options' => array(
+ '1' => 'Label1',
+ '2' => 'Label2',
+ ),
+ ),
'current_employer' => array(
- 'title' => 'Current Employer',
- 'description' => 'Name of Current Employer',
- 'type' => 2,
- ),
+ 'title' => 'Current Employer',
+ 'description' => 'Name of Current Employer',
+ 'type' => 2,
+ ),
'dupe_check' => array(
- 'title' => 'Check for Duplicates',
- 'description' => 'Throw error if contact create matches dedupe rule',
- ),
+ 'title' => 'Check for Duplicates',
+ 'description' => 'Throw error if contact create matches dedupe rule',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCustomFieldCreateWithOptionValues and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCustomFieldCreateWithOptionValues
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using contact getsingle API
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
+ */
+
+/**
+ * Test Generated example of using contact getsingle API.
+ *
* This demonstrates use of the 'format.single_entity_array' param.
/* This param causes the only contact to be returned as an array without the other levels.
- /* it will be ignored if there is not exactly 1 result *
+ /* it will be ignored if there is not exactly 1 result
+ *
+ * @return array
+ * API result array
*/
-function contact_getsingle_example(){
-$params = array(
- 'id' => 17,
-);
+function contact_getsingle_example() {
+ $params = array(
+ 'id' => 17,
+ );
-try{
- $result = civicrm_api3('contact', 'getsingle', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+ try{
+ $result = civicrm_api3('contact', 'getsingle', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
-return $result;
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function contact_getsingle_expectedresult(){
+function contact_getsingle_expectedresult() {
$expectedResult = array(
- 'contact_id' => '17',
- 'contact_type' => 'Individual',
- 'contact_sub_type' => '',
- 'sort_name' => '',
- 'display_name' => 'Test Contact',
- 'do_not_email' => '',
- 'do_not_phone' => '',
- 'do_not_mail' => '',
- 'do_not_sms' => '',
- 'do_not_trade' => '',
- 'is_opt_out' => 0,
- 'legal_identifier' => '',
- 'external_identifier' => '',
- 'nick_name' => '',
- 'legal_name' => '',
- 'image_URL' => '',
- 'preferred_communication_method' => '',
- 'preferred_language' => '',
- 'preferred_mail_format' => '',
- 'first_name' => 'Test',
- 'middle_name' => '',
- 'last_name' => 'Contact',
- 'prefix_id' => '',
- 'suffix_id' => '',
- 'formal_title' => '',
- 'communication_style_id' => '',
- 'job_title' => '',
- 'gender_id' => '',
- 'birth_date' => '',
- 'is_deceased' => 0,
- 'deceased_date' => '',
- 'household_name' => '',
- 'organization_name' => '',
- 'sic_code' => '',
- 'contact_is_deleted' => 0,
- 'current_employer' => '',
- 'address_id' => '',
- 'street_address' => '',
- 'supplemental_address_1' => '',
- 'supplemental_address_2' => '',
- 'city' => '',
- 'postal_code_suffix' => '',
- 'postal_code' => '',
- 'geo_code_1' => '',
- 'geo_code_2' => '',
- 'state_province_id' => '',
- 'country_id' => '',
- 'phone_id' => '',
- 'phone_type_id' => '',
- 'phone' => '',
- 'email_id' => '',
- 'email' => '',
- 'on_hold' => '',
- 'im_id' => '',
- 'provider_id' => '',
- 'im' => '',
- 'worldregion_id' => '',
- 'world_region' => '',
- 'individual_prefix' => '',
- 'individual_suffix' => '',
- 'communication_style' => '',
- 'gender' => '',
- 'state_province_name' => '',
- 'state_province' => '',
- 'country' => '',
- 'id' => '17',
-);
+ 'contact_id' => '17',
+ 'contact_type' => 'Individual',
+ 'contact_sub_type' => '',
+ 'sort_name' => '',
+ 'display_name' => 'Test Contact',
+ 'do_not_email' => '',
+ 'do_not_phone' => '',
+ 'do_not_mail' => '',
+ 'do_not_sms' => '',
+ 'do_not_trade' => '',
+ 'is_opt_out' => 0,
+ 'legal_identifier' => '',
+ 'external_identifier' => '',
+ 'nick_name' => '',
+ 'legal_name' => '',
+ 'image_URL' => '',
+ 'preferred_communication_method' => '',
+ 'preferred_language' => '',
+ 'preferred_mail_format' => '',
+ 'first_name' => 'Test',
+ 'middle_name' => '',
+ 'last_name' => 'Contact',
+ 'prefix_id' => '',
+ 'suffix_id' => '',
+ 'formal_title' => '',
+ 'communication_style_id' => '',
+ 'job_title' => '',
+ 'gender_id' => '',
+ 'birth_date' => '',
+ 'is_deceased' => 0,
+ 'deceased_date' => '',
+ 'household_name' => '',
+ 'organization_name' => '',
+ 'sic_code' => '',
+ 'contact_is_deleted' => 0,
+ 'current_employer' => '',
+ 'address_id' => '',
+ 'street_address' => '',
+ 'supplemental_address_1' => '',
+ 'supplemental_address_2' => '',
+ 'city' => '',
+ 'postal_code_suffix' => '',
+ 'postal_code' => '',
+ 'geo_code_1' => '',
+ 'geo_code_2' => '',
+ 'state_province_id' => '',
+ 'country_id' => '',
+ 'phone_id' => '',
+ 'phone_type_id' => '',
+ 'phone' => '',
+ 'email_id' => '',
+ 'email' => '',
+ 'on_hold' => '',
+ 'im_id' => '',
+ 'provider_id' => '',
+ 'im' => '',
+ 'worldregion_id' => '',
+ 'world_region' => '',
+ 'individual_prefix' => '',
+ 'individual_suffix' => '',
+ 'communication_style' => '',
+ 'gender' => '',
+ 'state_province_name' => '',
+ 'state_province' => '',
+ 'country' => '',
+ 'id' => '17',
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testContactGetSingle_entity_array and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testContactGetSingle_entity_array
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using contact getoptions API
- * Demonstrates retrieving options for a custom field *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function contact_getoptions_example(){
-$params = array(
- 'field' => 'custom_1',
-);
-try{
- $result = civicrm_api3('contact', 'getoptions', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using contact getoptions API.
+ *
+ * Demonstrates retrieving options for a custom field
+ *
+ * @return array
+ * API result array
+ */
+function contact_getoptions_example() {
+ $params = array(
+ 'field' => 'custom_1',
+ );
-return $result;
+ try{
+ $result = civicrm_api3('contact', 'getoptions', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function contact_getoptions_expectedresult(){
+function contact_getoptions_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 2,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 2,
+ 'values' => array(
'1' => 'Label1',
'2' => 'Label2',
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCustomFieldCreateWithOptionValues and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCustomFieldCreateWithOptionValues
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using contact get API
- * Get all from group and display contacts *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function contact_get_example(){
-$params = array(
- 'filter.group_id' => array(
+
+/**
+ * Test Generated example of using contact get API.
+ *
+ * Get all from group and display contacts
+ *
+ * @return array
+ * API result array
+ */
+function contact_get_example() {
+ $params = array(
+ 'filter.group_id' => array(
'0' => 1,
'1' => 26,
),
- 'contact_type' => 'Individual',
-);
+ 'contact_type' => 'Individual',
+ );
-try{
- $result = civicrm_api3('contact', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+ try{
+ $result = civicrm_api3('contact', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
-return $result;
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function contact_get_expectedresult(){
+function contact_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'contact_id' => '1',
- 'contact_type' => 'Individual',
- 'contact_sub_type' => '',
- 'sort_name' => 'man2@yahoo.com',
- 'display_name' => 'man2@yahoo.com',
- 'do_not_email' => 0,
- 'do_not_phone' => 0,
- 'do_not_mail' => 0,
- 'do_not_sms' => 0,
- 'do_not_trade' => 0,
- 'is_opt_out' => 0,
- 'legal_identifier' => '',
- 'external_identifier' => '',
- 'nick_name' => '',
- 'legal_name' => '',
- 'image_URL' => '',
- 'preferred_communication_method' => '',
- 'preferred_language' => 'en_US',
- 'preferred_mail_format' => 'Both',
- 'first_name' => '',
- 'middle_name' => '',
- 'last_name' => '',
- 'prefix_id' => '',
- 'suffix_id' => '',
- 'formal_title' => '',
- 'communication_style_id' => '',
- 'job_title' => '',
- 'gender_id' => '',
- 'birth_date' => '',
- 'is_deceased' => 0,
- 'deceased_date' => '',
- 'household_name' => '',
- 'organization_name' => '',
- 'sic_code' => '',
- 'contact_is_deleted' => 0,
- 'current_employer' => '',
- 'address_id' => '2',
- 'street_address' => '1 my road',
- 'supplemental_address_1' => '',
- 'supplemental_address_2' => '',
- 'city' => '',
- 'postal_code_suffix' => '',
- 'postal_code' => '',
- 'geo_code_1' => '',
- 'geo_code_2' => '',
- 'state_province_id' => '',
- 'country_id' => '',
- 'phone_id' => '',
- 'phone_type_id' => '',
- 'phone' => '',
- 'email_id' => '1',
- 'email' => 'man2@yahoo.com',
- 'on_hold' => 0,
- 'im_id' => '',
- 'provider_id' => '',
- 'im' => '',
- 'worldregion_id' => '',
- 'world_region' => '',
- 'individual_prefix' => '',
- 'individual_suffix' => '',
- 'communication_style' => '',
- 'gender' => '',
- 'state_province_name' => '',
- 'state_province' => '',
- 'country' => '',
- 'id' => '1',
- ),
+ 'contact_id' => '1',
+ 'contact_type' => 'Individual',
+ 'contact_sub_type' => '',
+ 'sort_name' => 'man2@yahoo.com',
+ 'display_name' => 'man2@yahoo.com',
+ 'do_not_email' => 0,
+ 'do_not_phone' => 0,
+ 'do_not_mail' => 0,
+ 'do_not_sms' => 0,
+ 'do_not_trade' => 0,
+ 'is_opt_out' => 0,
+ 'legal_identifier' => '',
+ 'external_identifier' => '',
+ 'nick_name' => '',
+ 'legal_name' => '',
+ 'image_URL' => '',
+ 'preferred_communication_method' => '',
+ 'preferred_language' => 'en_US',
+ 'preferred_mail_format' => 'Both',
+ 'first_name' => '',
+ 'middle_name' => '',
+ 'last_name' => '',
+ 'prefix_id' => '',
+ 'suffix_id' => '',
+ 'formal_title' => '',
+ 'communication_style_id' => '',
+ 'job_title' => '',
+ 'gender_id' => '',
+ 'birth_date' => '',
+ 'is_deceased' => 0,
+ 'deceased_date' => '',
+ 'household_name' => '',
+ 'organization_name' => '',
+ 'sic_code' => '',
+ 'contact_is_deleted' => 0,
+ 'current_employer' => '',
+ 'address_id' => '2',
+ 'street_address' => '1 my road',
+ 'supplemental_address_1' => '',
+ 'supplemental_address_2' => '',
+ 'city' => '',
+ 'postal_code_suffix' => '',
+ 'postal_code' => '',
+ 'geo_code_1' => '',
+ 'geo_code_2' => '',
+ 'state_province_id' => '',
+ 'country_id' => '',
+ 'phone_id' => '',
+ 'phone_type_id' => '',
+ 'phone' => '',
+ 'email_id' => '1',
+ 'email' => 'man2@yahoo.com',
+ 'on_hold' => 0,
+ 'im_id' => '',
+ 'provider_id' => '',
+ 'im' => '',
+ 'worldregion_id' => '',
+ 'world_region' => '',
+ 'individual_prefix' => '',
+ 'individual_suffix' => '',
+ 'communication_style' => '',
+ 'gender' => '',
+ 'state_province_name' => '',
+ 'state_province' => '',
+ 'country' => '',
+ 'id' => '1',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetGroupIDFromContact and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetGroupIDFromContact
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using contribution create API
- * Demonstrates creating contribution with Soft Credit by passing in honor_contact_id *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function contribution_create_example(){
-$params = array(
- 'contact_id' => 3,
- 'receive_date' => '20120511',
- 'total_amount' => '100',
- 'financial_type_id' => 1,
- 'non_deductible_amount' => '10',
- 'fee_amount' => '5',
- 'net_amount' => '95',
- 'source' => 'SSF',
- 'contribution_status_id' => 1,
- 'honor_contact_id' => 4,
-);
-try{
- $result = civicrm_api3('contribution', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using contribution create API.
+ *
+ * Demonstrates creating contribution with Soft Credit by passing in honor_contact_id
+ *
+ * @return array
+ * API result array
+ */
+function contribution_create_example() {
+ $params = array(
+ 'contact_id' => 24,
+ 'receive_date' => '20120511',
+ 'total_amount' => '100',
+ 'financial_type_id' => 1,
+ 'non_deductible_amount' => '10',
+ 'fee_amount' => '5',
+ 'net_amount' => '95',
+ 'source' => 'SSF',
+ 'contribution_status_id' => 1,
+ 'honor_contact_id' => 25,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('contribution', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function contribution_create_expectedresult(){
+function contribution_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'contact_id' => '3',
- 'financial_type_id' => '1',
- 'contribution_page_id' => '',
- 'payment_instrument_id' => '4',
- 'receive_date' => '20120511000000',
- 'non_deductible_amount' => '10',
- 'total_amount' => '100',
- 'fee_amount' => '5',
- 'net_amount' => '95',
- 'trxn_id' => '',
- 'invoice_id' => '',
- 'currency' => 'USD',
- 'cancel_date' => '',
- 'cancel_reason' => '',
- 'receipt_date' => '',
- 'thankyou_date' => '',
- 'source' => 'SSF',
- 'amount_level' => '',
- 'contribution_recur_id' => '',
- 'is_test' => '',
- 'is_pay_later' => '',
- 'contribution_status_id' => '1',
- 'address_id' => '',
- 'check_number' => '',
- 'campaign_id' => '',
- 'creditnote_id' => '',
- 'tax_amount' => '',
- 'contribution_type_id' => '1',
- ),
+ 'id' => '1',
+ 'contact_id' => '24',
+ 'financial_type_id' => '1',
+ 'contribution_page_id' => '',
+ 'payment_instrument_id' => '4',
+ 'receive_date' => '20120511000000',
+ 'non_deductible_amount' => '10',
+ 'total_amount' => '100',
+ 'fee_amount' => '5',
+ 'net_amount' => '95',
+ 'trxn_id' => '',
+ 'invoice_id' => '',
+ 'currency' => 'USD',
+ 'cancel_date' => '',
+ 'cancel_reason' => '',
+ 'receipt_date' => '',
+ 'thankyou_date' => '',
+ 'source' => 'SSF',
+ 'amount_level' => '',
+ 'contribution_recur_id' => '',
+ 'is_test' => '',
+ 'is_pay_later' => '',
+ 'contribution_status_id' => '1',
+ 'address_id' => '',
+ 'check_number' => '',
+ 'campaign_id' => '',
+ 'creditnote_id' => '',
+ 'tax_amount' => '',
+ 'contribution_type_id' => '1',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreateContributionWithHonoreeContact and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreateContributionWithHonoreeContact
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContributionTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using contribution create API
- * Demonstrates creating contribution with Note Entity *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function contribution_create_example(){
-$params = array(
- 'contact_id' => 1,
- 'receive_date' => '2012-01-01',
- 'total_amount' => '100',
- 'financial_type_id' => 1,
- 'payment_instrument_id' => 1,
- 'non_deductible_amount' => '10',
- 'fee_amount' => '50',
- 'net_amount' => '90',
- 'trxn_id' => 12345,
- 'invoice_id' => 67890,
- 'source' => 'SSF',
- 'contribution_status_id' => 1,
- 'note' => 'my contribution note',
-);
-try{
- $result = civicrm_api3('contribution', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using contribution create API.
+ *
+ * Demonstrates creating contribution with Note Entity
+ *
+ * @return array
+ * API result array
+ */
+function contribution_create_example() {
+ $params = array(
+ 'contact_id' => 18,
+ 'receive_date' => '2012-01-01',
+ 'total_amount' => '100',
+ 'financial_type_id' => 1,
+ 'payment_instrument_id' => 1,
+ 'non_deductible_amount' => '10',
+ 'fee_amount' => '50',
+ 'net_amount' => '90',
+ 'trxn_id' => 12345,
+ 'invoice_id' => 67890,
+ 'source' => 'SSF',
+ 'contribution_status_id' => 1,
+ 'note' => 'my contribution note',
+ );
-return $result;
+ try{
+ $result = civicrm_api3('contribution', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function contribution_create_expectedresult(){
+function contribution_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'contact_id' => '1',
- 'financial_type_id' => '1',
- 'contribution_page_id' => '',
- 'payment_instrument_id' => '1',
- 'receive_date' => '20120101000000',
- 'non_deductible_amount' => '10',
- 'total_amount' => '100',
- 'fee_amount' => '50',
- 'net_amount' => '90',
- 'trxn_id' => '12345',
- 'invoice_id' => '67890',
- 'currency' => 'USD',
- 'cancel_date' => '',
- 'cancel_reason' => '',
- 'receipt_date' => '',
- 'thankyou_date' => '',
- 'source' => 'SSF',
- 'amount_level' => '',
- 'contribution_recur_id' => '',
- 'is_test' => '',
- 'is_pay_later' => '',
- 'contribution_status_id' => '1',
- 'address_id' => '',
- 'check_number' => '',
- 'campaign_id' => '',
- 'creditnote_id' => '',
- 'tax_amount' => '',
- 'contribution_type_id' => '1',
- ),
+ 'id' => '1',
+ 'contact_id' => '18',
+ 'financial_type_id' => '1',
+ 'contribution_page_id' => '',
+ 'payment_instrument_id' => '1',
+ 'receive_date' => '20120101000000',
+ 'non_deductible_amount' => '10',
+ 'total_amount' => '100',
+ 'fee_amount' => '50',
+ 'net_amount' => '90',
+ 'trxn_id' => '12345',
+ 'invoice_id' => '67890',
+ 'currency' => 'USD',
+ 'cancel_date' => '',
+ 'cancel_reason' => '',
+ 'receipt_date' => '',
+ 'thankyou_date' => '',
+ 'source' => 'SSF',
+ 'amount_level' => '',
+ 'contribution_recur_id' => '',
+ 'is_test' => '',
+ 'is_pay_later' => '',
+ 'contribution_status_id' => '1',
+ 'address_id' => '',
+ 'check_number' => '',
+ 'campaign_id' => '',
+ 'creditnote_id' => '',
+ 'tax_amount' => '',
+ 'contribution_type_id' => '1',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreateContributionWithNote and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreateContributionWithNote
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContributionTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using contribution create API
- * Demonstrates creating contribution with SoftCredit *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function contribution_create_example(){
-$params = array(
- 'contact_id' => 1,
- 'receive_date' => '20120511',
- 'total_amount' => '100',
- 'financial_type_id' => 1,
- 'non_deductible_amount' => '10',
- 'fee_amount' => '5',
- 'net_amount' => '95',
- 'source' => 'SSF',
- 'contribution_status_id' => 1,
- 'soft_credit' => array(
+
+/**
+ * Test Generated example of using contribution create API.
+ *
+ * Demonstrates creating contribution with SoftCredit
+ *
+ * @return array
+ * API result array
+ */
+function contribution_create_example() {
+ $params = array(
+ 'contact_id' => 20,
+ 'receive_date' => '20120511',
+ 'total_amount' => '100',
+ 'financial_type_id' => 1,
+ 'non_deductible_amount' => '10',
+ 'fee_amount' => '5',
+ 'net_amount' => '95',
+ 'source' => 'SSF',
+ 'contribution_status_id' => 1,
+ 'soft_credit' => array(
'1' => array(
- 'contact_id' => 2,
- 'amount' => 50,
- 'soft_credit_type_id' => 3,
- ),
+ 'contact_id' => 21,
+ 'amount' => 50,
+ 'soft_credit_type_id' => 3,
+ ),
),
-);
+ );
-try{
- $result = civicrm_api3('contribution', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+ try{
+ $result = civicrm_api3('contribution', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
-return $result;
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function contribution_create_expectedresult(){
+function contribution_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'contact_id' => '1',
- 'financial_type_id' => '1',
- 'contribution_page_id' => '',
- 'payment_instrument_id' => '4',
- 'receive_date' => '20120511000000',
- 'non_deductible_amount' => '10',
- 'total_amount' => '100',
- 'fee_amount' => '5',
- 'net_amount' => '95',
- 'trxn_id' => '',
- 'invoice_id' => '',
- 'currency' => 'USD',
- 'cancel_date' => '',
- 'cancel_reason' => '',
- 'receipt_date' => '',
- 'thankyou_date' => '',
- 'source' => 'SSF',
- 'amount_level' => '',
- 'contribution_recur_id' => '',
- 'is_test' => '',
- 'is_pay_later' => '',
- 'contribution_status_id' => '1',
- 'address_id' => '',
- 'check_number' => '',
- 'campaign_id' => '',
- 'creditnote_id' => '',
- 'tax_amount' => '',
- 'contribution_type_id' => '1',
- ),
+ 'id' => '1',
+ 'contact_id' => '20',
+ 'financial_type_id' => '1',
+ 'contribution_page_id' => '',
+ 'payment_instrument_id' => '4',
+ 'receive_date' => '20120511000000',
+ 'non_deductible_amount' => '10',
+ 'total_amount' => '100',
+ 'fee_amount' => '5',
+ 'net_amount' => '95',
+ 'trxn_id' => '',
+ 'invoice_id' => '',
+ 'currency' => 'USD',
+ 'cancel_date' => '',
+ 'cancel_reason' => '',
+ 'receipt_date' => '',
+ 'thankyou_date' => '',
+ 'source' => 'SSF',
+ 'amount_level' => '',
+ 'contribution_recur_id' => '',
+ 'is_test' => '',
+ 'is_pay_later' => '',
+ 'contribution_status_id' => '1',
+ 'address_id' => '',
+ 'check_number' => '',
+ 'campaign_id' => '',
+ 'creditnote_id' => '',
+ 'tax_amount' => '',
+ 'contribution_type_id' => '1',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreateContributionWithSoftCredt and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreateContributionWithSoftCredt
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContributionTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using contribution create API
- * Demonstrates creating contribution with Soft Credit defaults for amount and type *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function contribution_create_example(){
-$params = array(
- 'contact_id' => 3,
- 'receive_date' => '20120511',
- 'total_amount' => '100',
- 'financial_type_id' => 1,
- 'non_deductible_amount' => '10',
- 'fee_amount' => '5',
- 'net_amount' => '95',
- 'source' => 'SSF',
- 'contribution_status_id' => 1,
- 'soft_credit_to' => 4,
-);
-try{
- $result = civicrm_api3('contribution', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using contribution create API.
+ *
+ * Demonstrates creating contribution with Soft Credit defaults for amount and type
+ *
+ * @return array
+ * API result array
+ */
+function contribution_create_example() {
+ $params = array(
+ 'contact_id' => 22,
+ 'receive_date' => '20120511',
+ 'total_amount' => '100',
+ 'financial_type_id' => 1,
+ 'non_deductible_amount' => '10',
+ 'fee_amount' => '5',
+ 'net_amount' => '95',
+ 'source' => 'SSF',
+ 'contribution_status_id' => 1,
+ 'soft_credit_to' => 23,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('contribution', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function contribution_create_expectedresult(){
+function contribution_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'contact_id' => '3',
- 'financial_type_id' => '1',
- 'contribution_page_id' => '',
- 'payment_instrument_id' => '4',
- 'receive_date' => '20120511000000',
- 'non_deductible_amount' => '10',
- 'total_amount' => '100',
- 'fee_amount' => '5',
- 'net_amount' => '95',
- 'trxn_id' => '',
- 'invoice_id' => '',
- 'currency' => 'USD',
- 'cancel_date' => '',
- 'cancel_reason' => '',
- 'receipt_date' => '',
- 'thankyou_date' => '',
- 'source' => 'SSF',
- 'amount_level' => '',
- 'contribution_recur_id' => '',
- 'is_test' => '',
- 'is_pay_later' => '',
- 'contribution_status_id' => '1',
- 'address_id' => '',
- 'check_number' => '',
- 'campaign_id' => '',
- 'creditnote_id' => '',
- 'tax_amount' => '',
- 'contribution_type_id' => '1',
- ),
+ 'id' => '1',
+ 'contact_id' => '22',
+ 'financial_type_id' => '1',
+ 'contribution_page_id' => '',
+ 'payment_instrument_id' => '4',
+ 'receive_date' => '20120511000000',
+ 'non_deductible_amount' => '10',
+ 'total_amount' => '100',
+ 'fee_amount' => '5',
+ 'net_amount' => '95',
+ 'trxn_id' => '',
+ 'invoice_id' => '',
+ 'currency' => 'USD',
+ 'cancel_date' => '',
+ 'cancel_reason' => '',
+ 'receipt_date' => '',
+ 'thankyou_date' => '',
+ 'source' => 'SSF',
+ 'amount_level' => '',
+ 'contribution_recur_id' => '',
+ 'is_test' => '',
+ 'is_pay_later' => '',
+ 'contribution_status_id' => '1',
+ 'address_id' => '',
+ 'check_number' => '',
+ 'campaign_id' => '',
+ 'creditnote_id' => '',
+ 'tax_amount' => '',
+ 'contribution_type_id' => '1',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreateContributionWithSoftCreditDefaults and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreateContributionWithSoftCreditDefaults
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContributionTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using contribution create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function contribution_create_example(){
-$params = array(
- 'contact_id' => 1,
- 'receive_date' => '20120511',
- 'total_amount' => '100',
- 'financial_type_id' => 1,
- 'contribution_page_id' => 1,
- 'trxn_id' => 12345,
- 'invoice_id' => 67890,
- 'source' => 'SSF',
- 'contribution_status_id' => 2,
-);
-try{
- $result = civicrm_api3('contribution', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using contribution create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function contribution_create_example() {
+ $params = array(
+ 'contact_id' => 32,
+ 'receive_date' => '20120511',
+ 'total_amount' => '100',
+ 'financial_type_id' => 1,
+ 'contribution_page_id' => 1,
+ 'trxn_id' => 12345,
+ 'invoice_id' => 67890,
+ 'source' => 'SSF',
+ 'contribution_status_id' => 2,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('contribution', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function contribution_create_expectedresult(){
+function contribution_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'contact_id' => '1',
- 'financial_type_id' => '1',
- 'contribution_page_id' => '1',
- 'payment_instrument_id' => '4',
- 'receive_date' => '20120511000000',
- 'non_deductible_amount' => '',
- 'total_amount' => '100',
- 'fee_amount' => 0,
- 'net_amount' => '100',
- 'trxn_id' => '12345',
- 'invoice_id' => '67890',
- 'currency' => 'USD',
- 'cancel_date' => '',
- 'cancel_reason' => '',
- 'receipt_date' => '',
- 'thankyou_date' => '',
- 'source' => 'SSF',
- 'amount_level' => '',
- 'contribution_recur_id' => '',
- 'is_test' => '',
- 'is_pay_later' => '',
- 'contribution_status_id' => '2',
- 'address_id' => '',
- 'check_number' => '',
- 'campaign_id' => '',
- 'creditnote_id' => '',
- 'tax_amount' => '',
- 'contribution_type_id' => '1',
- ),
+ 'id' => '1',
+ 'contact_id' => '32',
+ 'financial_type_id' => '1',
+ 'contribution_page_id' => '1',
+ 'payment_instrument_id' => '4',
+ 'receive_date' => '20120511000000',
+ 'non_deductible_amount' => '',
+ 'total_amount' => '100',
+ 'fee_amount' => 0,
+ 'net_amount' => '100',
+ 'trxn_id' => '12345',
+ 'invoice_id' => '67890',
+ 'currency' => 'USD',
+ 'cancel_date' => '',
+ 'cancel_reason' => '',
+ 'receipt_date' => '',
+ 'thankyou_date' => '',
+ 'source' => 'SSF',
+ 'amount_level' => '',
+ 'contribution_recur_id' => '',
+ 'is_test' => '',
+ 'is_pay_later' => '',
+ 'contribution_status_id' => '2',
+ 'address_id' => '',
+ 'check_number' => '',
+ 'campaign_id' => '',
+ 'creditnote_id' => '',
+ 'tax_amount' => '',
+ 'contribution_type_id' => '1',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreateContributionPendingOnline and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreateContributionPendingOnline
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContributionTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using contribution create API
- * Create Contribution with Nested Line Items *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function contribution_create_example(){
-$params = array(
- 'contact_id' => 1,
- 'receive_date' => '20120511',
- 'total_amount' => '100',
- 'financial_type_id' => 1,
- 'payment_instrument_id' => 1,
- 'non_deductible_amount' => '10',
- 'fee_amount' => '50',
- 'net_amount' => '90',
- 'trxn_id' => 12345,
- 'invoice_id' => 67890,
- 'source' => 'SSF',
- 'contribution_status_id' => 1,
- 'skipLineItem' => 1,
- 'api.line_item.create' => array(
+
+/**
+ * Test Generated example of using contribution create API.
+ *
+ * Create Contribution with Nested Line Items
+ *
+ * @return array
+ * API result array
+ */
+function contribution_create_example() {
+ $params = array(
+ 'contact_id' => 10,
+ 'receive_date' => '20120511',
+ 'total_amount' => '100',
+ 'financial_type_id' => 1,
+ 'payment_instrument_id' => 1,
+ 'non_deductible_amount' => '10',
+ 'fee_amount' => '50',
+ 'net_amount' => '90',
+ 'trxn_id' => 12345,
+ 'invoice_id' => 67890,
+ 'source' => 'SSF',
+ 'contribution_status_id' => 1,
+ 'skipLineItem' => 1,
+ 'api.line_item.create' => array(
'0' => array(
- 'price_field_id' => 1,
- 'qty' => 2,
- 'line_total' => '20',
- 'unit_price' => '10',
- ),
+ 'price_field_id' => 1,
+ 'qty' => 2,
+ 'line_total' => '20',
+ 'unit_price' => '10',
+ ),
'1' => array(
- 'price_field_id' => 1,
- 'qty' => 1,
- 'line_total' => '80',
- 'unit_price' => '80',
- ),
+ 'price_field_id' => 1,
+ 'qty' => 1,
+ 'line_total' => '80',
+ 'unit_price' => '80',
+ ),
),
-);
+ );
-try{
- $result = civicrm_api3('contribution', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+ try{
+ $result = civicrm_api3('contribution', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
-return $result;
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function contribution_create_expectedresult(){
+function contribution_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'contact_id' => '1',
- 'financial_type_id' => '1',
- 'contribution_page_id' => '',
- 'payment_instrument_id' => '1',
- 'receive_date' => '20120511000000',
- 'non_deductible_amount' => '10',
- 'total_amount' => '100',
- 'fee_amount' => '50',
- 'net_amount' => '90',
- 'trxn_id' => '12345',
- 'invoice_id' => '67890',
- 'currency' => 'USD',
- 'cancel_date' => '',
- 'cancel_reason' => '',
- 'receipt_date' => '',
- 'thankyou_date' => '',
- 'source' => 'SSF',
- 'amount_level' => '',
- 'contribution_recur_id' => '',
- 'is_test' => '',
- 'is_pay_later' => '',
- 'contribution_status_id' => '1',
- 'address_id' => '',
- 'check_number' => '',
- 'campaign_id' => '',
- 'creditnote_id' => '',
- 'tax_amount' => 0,
- 'contribution_type_id' => '1',
- 'api.line_item.create' => array(
+ 'id' => '1',
+ 'contact_id' => '10',
+ 'financial_type_id' => '1',
+ 'contribution_page_id' => '',
+ 'payment_instrument_id' => '1',
+ 'receive_date' => '20120511000000',
+ 'non_deductible_amount' => '10',
+ 'total_amount' => '100',
+ 'fee_amount' => '50',
+ 'net_amount' => '90',
+ 'trxn_id' => '12345',
+ 'invoice_id' => '67890',
+ 'currency' => 'USD',
+ 'cancel_date' => '',
+ 'cancel_reason' => '',
+ 'receipt_date' => '',
+ 'thankyou_date' => '',
+ 'source' => 'SSF',
+ 'amount_level' => '',
+ 'contribution_recur_id' => '',
+ 'is_test' => '',
+ 'is_pay_later' => '',
+ 'contribution_status_id' => '1',
+ 'address_id' => '',
+ 'check_number' => '',
+ 'campaign_id' => '',
+ 'creditnote_id' => '',
+ 'tax_amount' => 0,
+ 'contribution_type_id' => '1',
+ 'api.line_item.create' => array(
+ '0' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
+ '0' => array(
+ 'id' => '1',
+ 'entity_table' => 'civicrm_contribution',
+ 'entity_id' => '1',
+ 'contribution_id' => '1',
+ 'price_field_id' => '1',
+ 'label' => 'line item',
+ 'qty' => '2',
+ 'unit_price' => '10',
+ 'line_total' => '20',
+ 'participant_count' => '',
+ 'price_field_value_id' => '',
+ 'financial_type_id' => '',
+ 'deductible_amount' => '',
+ 'tax_amount' => '',
+ ),
+ ),
+ ),
+ '1' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 2,
+ 'values' => array(
'0' => array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
- '0' => array(
- 'id' => '1',
- 'entity_table' => 'civicrm_contribution',
- 'entity_id' => '1',
- 'contribution_id' => '1',
- 'price_field_id' => '1',
- 'label' => 'line item',
- 'qty' => '2',
- 'unit_price' => '10',
- 'line_total' => '20',
- 'participant_count' => '',
- 'price_field_value_id' => '',
- 'financial_type_id' => '',
- 'deductible_amount' => '',
- 'tax_amount' => '',
- ),
- ),
- ),
- '1' => array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 2,
- 'values' => array(
- '0' => array(
- 'id' => '2',
- 'entity_table' => 'civicrm_contribution',
- 'entity_id' => '1',
- 'contribution_id' => '1',
- 'price_field_id' => '1',
- 'label' => 'line item',
- 'qty' => '1',
- 'unit_price' => '80',
- 'line_total' => '80',
- 'participant_count' => '',
- 'price_field_value_id' => '',
- 'financial_type_id' => '',
- 'deductible_amount' => '',
- 'tax_amount' => '',
- ),
- ),
- ),
+ 'id' => '2',
+ 'entity_table' => 'civicrm_contribution',
+ 'entity_id' => '1',
+ 'contribution_id' => '1',
+ 'price_field_id' => '1',
+ 'label' => 'line item',
+ 'qty' => '1',
+ 'unit_price' => '80',
+ 'line_total' => '80',
+ 'participant_count' => '',
+ 'price_field_value_id' => '',
+ 'financial_type_id' => '',
+ 'deductible_amount' => '',
+ 'tax_amount' => '',
+ ),
),
+ ),
),
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreateContributionChainedLineItems and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreateContributionChainedLineItems
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContributionTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using contribution delete API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function contribution_delete_example(){
-$params = array(
- 'id' => 1,
-);
-try{
- $result = civicrm_api3('contribution', 'delete', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using contribution delete API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function contribution_delete_example() {
+ $params = array(
+ 'id' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('contribution', 'delete', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function contribution_delete_expectedresult(){
+function contribution_delete_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => 1,
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testDeleteContribution and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testDeleteContribution
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContributionTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using contribution get API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function contribution_get_example(){
-$params = array(
- 'contribution_id' => 1,
-);
-try{
- $result = civicrm_api3('contribution', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using contribution get API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function contribution_get_example() {
+ $params = array(
+ 'contribution_id' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('contribution', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function contribution_get_expectedresult(){
+function contribution_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'contact_id' => '1',
- 'contact_type' => 'Individual',
- 'contact_sub_type' => '',
- 'sort_name' => 'Anderson, Anthony',
- 'display_name' => 'Mr. Anthony Anderson II',
- 'contribution_id' => '1',
- 'currency' => 'USD',
- 'receive_date' => '2010-01-20 00:00:00',
- 'non_deductible_amount' => '10.00',
- 'total_amount' => '100.00',
- 'fee_amount' => '5.00',
- 'net_amount' => '95.00',
- 'trxn_id' => '23456',
- 'invoice_id' => '78910',
- 'cancel_date' => '',
- 'cancel_reason' => '',
- 'receipt_date' => '',
- 'thankyou_date' => '',
- 'contribution_source' => 'SSF',
- 'amount_level' => '',
- 'is_test' => 0,
- 'is_pay_later' => 0,
- 'contribution_status_id' => '1',
- 'check_number' => '',
- 'contribution_campaign_id' => '',
- 'financial_type_id' => '1',
- 'financial_type' => 'Donation',
- 'instrument_id' => '87',
- 'payment_instrument' => 'Check',
- 'product_id' => '',
- 'product_name' => '',
- 'sku' => '',
- 'contribution_product_id' => '',
- 'product_option' => '',
- 'fulfilled_date' => '',
- 'contribution_start_date' => '',
- 'contribution_end_date' => '',
- 'contribution_recur_id' => '',
- 'financial_account_id' => '1',
- 'accounting_code' => '4200',
- 'contribution_note' => '',
- 'contribution_batch' => '',
- 'contribution_status' => 'Completed',
- 'contribution_payment_instrument' => 'Check',
- 'contribution_check_number' => '',
- 'id' => '1',
- 'contribution_type_id' => '1',
- ),
+ 'contact_id' => '4',
+ 'contact_type' => 'Individual',
+ 'contact_sub_type' => '',
+ 'sort_name' => 'Anderson, Anthony',
+ 'display_name' => 'Mr. Anthony Anderson II',
+ 'contribution_id' => '1',
+ 'currency' => 'USD',
+ 'receive_date' => '2010-01-20 00:00:00',
+ 'non_deductible_amount' => '10.00',
+ 'total_amount' => '100.00',
+ 'fee_amount' => '5.00',
+ 'net_amount' => '95.00',
+ 'trxn_id' => '23456',
+ 'invoice_id' => '78910',
+ 'cancel_date' => '',
+ 'cancel_reason' => '',
+ 'receipt_date' => '',
+ 'thankyou_date' => '',
+ 'contribution_source' => 'SSF',
+ 'amount_level' => '',
+ 'is_test' => 0,
+ 'is_pay_later' => 0,
+ 'contribution_status_id' => '1',
+ 'check_number' => '',
+ 'contribution_campaign_id' => '',
+ 'financial_type_id' => '1',
+ 'financial_type' => 'Donation',
+ 'instrument_id' => '89',
+ 'payment_instrument' => 'Check',
+ 'product_id' => '',
+ 'product_name' => '',
+ 'sku' => '',
+ 'contribution_product_id' => '',
+ 'product_option' => '',
+ 'fulfilled_date' => '',
+ 'contribution_start_date' => '',
+ 'contribution_end_date' => '',
+ 'contribution_recur_id' => '',
+ 'financial_account_id' => '1',
+ 'accounting_code' => '4200',
+ 'contribution_note' => '',
+ 'contribution_batch' => '',
+ 'contribution_status' => 'Completed',
+ 'contribution_payment_instrument' => 'Check',
+ 'contribution_check_number' => '',
+ 'id' => '1',
+ 'contribution_type_id' => '1',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetContributionLegacyBehaviour and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetContributionLegacyBehaviour
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContributionTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using contribution_page create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function contribution_page_create_example(){
-$params = array(
- 'title' => 'Test Contribution Page',
- 'financial_type_id' => 1,
- 'currency' => 'NZD',
- 'goal_amount' => 34567,
- 'is_pay_later' => 1,
- 'is_monetary' => true,
-);
-try{
- $result = civicrm_api3('contribution_page', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using contribution_page create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function contribution_page_create_example() {
+ $params = array(
+ 'title' => 'Test Contribution Page',
+ 'financial_type_id' => 1,
+ 'currency' => 'NZD',
+ 'goal_amount' => 34567,
+ 'is_pay_later' => 1,
+ 'is_monetary' => TRUE,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('contribution_page', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function contribution_page_create_expectedresult(){
+function contribution_page_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'title' => 'Test Contribution Page',
- 'intro_text' => '',
- 'financial_type_id' => '1',
- 'payment_processor' => '',
- 'is_credit_card_only' => '',
- 'is_monetary' => '1',
- 'is_recur' => '',
- 'is_confirm_enabled' => '',
- 'recur_frequency_unit' => '',
- 'is_recur_interval' => '',
- 'is_recur_installments' => '',
- 'is_pay_later' => '1',
- 'pay_later_text' => '',
- 'pay_later_receipt' => '',
- 'is_partial_payment' => '',
- 'initial_amount_label' => '',
- 'initial_amount_help_text' => '',
- 'min_initial_amount' => '',
- 'is_allow_other_amount' => '',
- 'default_amount_id' => '',
- 'min_amount' => '',
- 'max_amount' => '',
- 'goal_amount' => '34567',
- 'thankyou_title' => '',
- 'thankyou_text' => '',
- 'thankyou_footer' => '',
- 'is_for_organization' => '',
- 'for_organization' => '',
- 'is_email_receipt' => '',
- 'receipt_from_name' => '',
- 'receipt_from_email' => '',
- 'cc_receipt' => '',
- 'bcc_receipt' => '',
- 'receipt_text' => '',
- 'is_active' => '1',
- 'footer_text' => '',
- 'amount_block_is_active' => '',
- 'start_date' => '',
- 'end_date' => '',
- 'created_id' => '',
- 'created_date' => '',
- 'currency' => 'NZD',
- 'campaign_id' => '',
- 'is_share' => '',
- 'is_billing_required' => '',
- ),
+ 'id' => '1',
+ 'title' => 'Test Contribution Page',
+ 'intro_text' => '',
+ 'financial_type_id' => '1',
+ 'payment_processor' => '',
+ 'is_credit_card_only' => '',
+ 'is_monetary' => '1',
+ 'is_recur' => '',
+ 'is_confirm_enabled' => '',
+ 'recur_frequency_unit' => '',
+ 'is_recur_interval' => '',
+ 'is_recur_installments' => '',
+ 'is_pay_later' => '1',
+ 'pay_later_text' => '',
+ 'pay_later_receipt' => '',
+ 'is_partial_payment' => '',
+ 'initial_amount_label' => '',
+ 'initial_amount_help_text' => '',
+ 'min_initial_amount' => '',
+ 'is_allow_other_amount' => '',
+ 'default_amount_id' => '',
+ 'min_amount' => '',
+ 'max_amount' => '',
+ 'goal_amount' => '34567',
+ 'thankyou_title' => '',
+ 'thankyou_text' => '',
+ 'thankyou_footer' => '',
+ 'is_for_organization' => '',
+ 'for_organization' => '',
+ 'is_email_receipt' => '',
+ 'receipt_from_name' => '',
+ 'receipt_from_email' => '',
+ 'cc_receipt' => '',
+ 'bcc_receipt' => '',
+ 'receipt_text' => '',
+ 'is_active' => '1',
+ 'footer_text' => '',
+ 'amount_block_is_active' => '',
+ 'start_date' => '',
+ 'end_date' => '',
+ 'created_id' => '',
+ 'created_date' => '',
+ 'currency' => 'NZD',
+ 'campaign_id' => '',
+ 'is_share' => '',
+ 'is_billing_required' => '',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreateContributionPage and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreateContributionPage
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContributionPageTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using contribution_page delete API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function contribution_page_delete_example(){
-$params = array(
- 'id' => 1,
-);
-try{
- $result = civicrm_api3('contribution_page', 'delete', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using contribution_page delete API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function contribution_page_delete_example() {
+ $params = array(
+ 'id' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('contribution_page', 'delete', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function contribution_page_delete_expectedresult(){
+function contribution_page_delete_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'values' => 1,
-);
+ '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
-*
-* testDeleteContributionPage and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testDeleteContributionPage
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContributionPageTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using contribution_page get API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function contribution_page_get_example(){
-$params = array(
- 'amount' => '34567',
- 'currency' => 'NZD',
- 'financial_type_id' => 1,
-);
-try{
- $result = civicrm_api3('contribution_page', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using contribution_page get API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function contribution_page_get_example() {
+ $params = array(
+ 'amount' => '34567',
+ 'currency' => 'NZD',
+ 'financial_type_id' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('contribution_page', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function contribution_page_get_expectedresult(){
+function contribution_page_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'title' => 'Test Contribution Page',
- 'financial_type_id' => '1',
- 'is_credit_card_only' => 0,
- 'is_monetary' => '1',
- 'is_recur' => 0,
- 'is_confirm_enabled' => '1',
- 'is_recur_interval' => 0,
- 'is_recur_installments' => 0,
- 'is_pay_later' => '1',
- 'is_partial_payment' => 0,
- 'is_allow_other_amount' => 0,
- 'goal_amount' => '34567.00',
- 'is_for_organization' => 0,
- 'is_email_receipt' => 0,
- 'is_active' => '1',
- 'amount_block_is_active' => '1',
- 'currency' => 'NZD',
- 'is_share' => '1',
- 'is_billing_required' => 0,
- ),
+ 'id' => '1',
+ 'title' => 'Test Contribution Page',
+ 'financial_type_id' => '1',
+ 'is_credit_card_only' => 0,
+ 'is_monetary' => '1',
+ 'is_recur' => 0,
+ 'is_confirm_enabled' => '1',
+ 'is_recur_interval' => 0,
+ 'is_recur_installments' => 0,
+ 'is_pay_later' => '1',
+ 'is_partial_payment' => 0,
+ 'is_allow_other_amount' => 0,
+ 'goal_amount' => '34567.00',
+ 'is_for_organization' => 0,
+ 'is_email_receipt' => 0,
+ 'is_active' => '1',
+ 'amount_block_is_active' => '1',
+ 'currency' => 'NZD',
+ 'is_share' => '1',
+ 'is_billing_required' => 0,
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetContributionPageByAmount and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetContributionPageByAmount
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContributionPageTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using contribution_page Submit API
- * submit contribution page *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function contribution_page_submit_example(){
-$params = array(
- 'price_3' => '',
- 'id' => 1,
- 'amount' => 10,
- 'billing_first_name' => 'Billy',
- 'billing_middle_name' => 'Goat',
- 'billing_last_name' => 'Gruff',
- 'email' => 'billy@goat.gruff',
- 'selectMembership' => array(
+
+/**
+ * Test Generated example of using contribution_page Submit API.
+ *
+ * submit contribution page
+ *
+ * @return array
+ * API result array
+ */
+function contribution_page_submit_example() {
+ $params = array(
+ 'price_3' => '',
+ 'id' => 1,
+ 'amount' => 10,
+ 'billing_first_name' => 'Billy',
+ 'billing_middle_name' => 'Goat',
+ 'billing_last_name' => 'Gruff',
+ 'email' => 'billy@goat.gruff',
+ 'selectMembership' => array(
'0' => 1,
),
- 'payment_processor' => 1,
- 'credit_card_number' => '4111111111111111',
- 'credit_card_type' => 'Visa',
- 'credit_card_exp_date' => array(
+ 'payment_processor' => 1,
+ 'credit_card_number' => '4111111111111111',
+ 'credit_card_type' => 'Visa',
+ 'credit_card_exp_date' => array(
'M' => 9,
'Y' => 2040,
),
- 'cvv2' => 123,
- 'is_recur' => 1,
- 'frequency_interval' => 1,
- 'frequency_unit' => 'month',
-);
+ 'cvv2' => 123,
+ 'is_recur' => 1,
+ 'frequency_interval' => 1,
+ 'frequency_unit' => 'month',
+ );
-try{
- $result = civicrm_api3('contribution_page', 'Submit', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+ try{
+ $result = civicrm_api3('contribution_page', 'Submit', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
-return $result;
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function contribution_page_submit_expectedresult(){
+function contribution_page_submit_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 0,
- 'values' => '',
-);
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 0,
+ 'values' => '',
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testSubmitMembershipPriceSetPaymentPaymentProcessorRecurDelayed and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testSubmitMembershipPriceSetPaymentPaymentProcessorRecurDelayed
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContributionPageTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using contribution_recur create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function contribution_recur_create_example(){
-$params = array(
- 'contact_id' => 3,
- 'installments' => '12',
- 'frequency_interval' => '1',
- 'amount' => '500',
- 'contribution_status_id' => 1,
- 'start_date' => '2012-01-01 00:00:00',
- 'currency' => 'USD',
- 'frequency_unit' => 'day',
-);
-try{
- $result = civicrm_api3('contribution_recur', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using contribution_recur create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function contribution_recur_create_example() {
+ $params = array(
+ 'contact_id' => 3,
+ 'installments' => '12',
+ 'frequency_interval' => '1',
+ 'amount' => '500',
+ 'contribution_status_id' => 1,
+ 'start_date' => '2012-01-01 00:00:00',
+ 'currency' => 'USD',
+ 'frequency_unit' => 'day',
+ );
-return $result;
+ try{
+ $result = civicrm_api3('contribution_recur', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function contribution_recur_create_expectedresult(){
+function contribution_recur_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'contact_id' => '3',
- 'amount' => '500',
- 'currency' => 'USD',
- 'frequency_unit' => 'day',
- 'frequency_interval' => '1',
- 'installments' => '12',
- 'start_date' => '2013-07-29 00:00:00',
- 'create_date' => '20120130621222105',
- 'modified_date' => '',
- 'cancel_date' => '',
- 'end_date' => '',
- 'processor_id' => '',
- 'trxn_id' => '',
- 'invoice_id' => '',
- 'contribution_status_id' => '1',
- 'is_test' => '',
- 'cycle_day' => '',
- 'next_sched_contribution_date' => '',
- 'failure_count' => '',
- 'failure_retry_date' => '',
- 'auto_renew' => '',
- 'payment_processor_id' => '',
- 'financial_type_id' => '',
- 'payment_instrument_id' => '',
- 'campaign_id' => '',
- 'is_email_receipt' => '',
- ),
+ 'id' => '1',
+ 'contact_id' => '3',
+ 'amount' => '500',
+ 'currency' => 'USD',
+ 'frequency_unit' => 'day',
+ 'frequency_interval' => '1',
+ 'installments' => '12',
+ 'start_date' => '2013-07-29 00:00:00',
+ 'create_date' => '20120130621222105',
+ 'modified_date' => '',
+ 'cancel_date' => '',
+ 'end_date' => '',
+ 'processor_id' => '',
+ 'trxn_id' => '',
+ 'invoice_id' => '',
+ 'contribution_status_id' => '1',
+ 'is_test' => '',
+ 'cycle_day' => '',
+ 'next_sched_contribution_date' => '',
+ 'failure_count' => '',
+ 'failure_retry_date' => '',
+ 'auto_renew' => '',
+ 'payment_processor_id' => '',
+ 'financial_type_id' => '',
+ 'payment_instrument_id' => '',
+ 'campaign_id' => '',
+ 'is_email_receipt' => '',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreateContributionRecur and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreateContributionRecur
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContributionRecurTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using contribution_recur delete API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function contribution_recur_delete_example(){
-$params = array(
- 'id' => 1,
-);
-try{
- $result = civicrm_api3('contribution_recur', 'delete', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using contribution_recur delete API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function contribution_recur_delete_example() {
+ $params = array(
+ 'id' => 3,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('contribution_recur', 'delete', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function contribution_recur_delete_expectedresult(){
+function contribution_recur_delete_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'values' => 1,
-);
+ '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
-*
-* testDeleteContributionRecur and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testDeleteContributionRecur
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContributionRecurTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using contribution_recur get API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function contribution_recur_get_example(){
-$params = array(
- 'amount' => '500',
-);
-try{
- $result = civicrm_api3('contribution_recur', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using contribution_recur get API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function contribution_recur_get_example() {
+ $params = array(
+ 'amount' => '500',
+ );
-return $result;
+ try{
+ $result = civicrm_api3('contribution_recur', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function contribution_recur_get_expectedresult(){
+function contribution_recur_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
- '1' => array(
- 'id' => '1',
- 'contact_id' => '4',
- 'amount' => '500.00',
- 'currency' => 'USD',
- 'frequency_unit' => 'day',
- 'frequency_interval' => '1',
- 'installments' => '12',
- 'start_date' => '2013-07-29 00:00:00',
- 'create_date' => '20120130621222105',
- 'contribution_status_id' => '1',
- 'is_test' => 0,
- 'cycle_day' => '1',
- 'failure_count' => 0,
- 'auto_renew' => 0,
- 'is_email_receipt' => '1',
- ),
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 2,
+ 'values' => array(
+ '2' => array(
+ 'id' => '2',
+ 'contact_id' => '4',
+ 'amount' => '500.00',
+ 'currency' => 'USD',
+ 'frequency_unit' => 'day',
+ 'frequency_interval' => '1',
+ 'installments' => '12',
+ 'start_date' => '2013-07-29 00:00:00',
+ 'create_date' => '20120130621222105',
+ 'contribution_status_id' => '1',
+ 'is_test' => 0,
+ 'cycle_day' => '1',
+ 'failure_count' => 0,
+ 'auto_renew' => 0,
+ 'is_email_receipt' => '1',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetContributionRecur and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetContributionRecur
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContributionRecurTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using contribution_soft create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function contribution_soft_create_example(){
-$params = array(
- 'contribution_id' => 1,
- 'contact_id' => 2,
- 'amount' => '10',
- 'currency' => 'USD',
- 'soft_credit_type_id' => 5,
-);
-try{
- $result = civicrm_api3('contribution_soft', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using contribution_soft create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function contribution_soft_create_example() {
+ $params = array(
+ 'contribution_id' => 6,
+ 'contact_id' => 19,
+ 'amount' => '10',
+ 'currency' => 'USD',
+ 'soft_credit_type_id' => 5,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('contribution_soft', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function contribution_soft_create_expectedresult(){
+function contribution_soft_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
- '1' => array(
- 'id' => '1',
- 'contribution_id' => '1',
- 'contact_id' => '2',
- 'amount' => '10',
- 'currency' => 'USD',
- 'pcp_id' => '',
- 'pcp_display_in_roll' => '',
- 'pcp_roll_nickname' => '',
- 'pcp_personal_note' => '',
- 'soft_credit_type_id' => '5',
- ),
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 5,
+ 'values' => array(
+ '5' => array(
+ 'id' => '5',
+ 'contribution_id' => '6',
+ 'contact_id' => '19',
+ 'amount' => '10',
+ 'currency' => 'USD',
+ 'pcp_id' => '',
+ 'pcp_display_in_roll' => '',
+ 'pcp_roll_nickname' => '',
+ 'pcp_personal_note' => '',
+ 'soft_credit_type_id' => '5',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreateContributionSoft and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreateContributionSoft
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContributionSoftTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using contribution_soft delete API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function contribution_soft_delete_example(){
-$params = array(
- 'id' => 1,
-);
-try{
- $result = civicrm_api3('contribution_soft', 'delete', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using contribution_soft delete API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function contribution_soft_delete_example() {
+ $params = array(
+ 'id' => 7,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('contribution_soft', 'delete', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function contribution_soft_delete_expectedresult(){
+function contribution_soft_delete_expectedresult() {
$expectedResult = '';
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testDeleteContributionSoft and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testDeleteContributionSoft
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContributionSoftTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using contribution_soft get API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function contribution_soft_get_example(){
-$params = array(
- 'id' => 1,
-);
-try{
- $result = civicrm_api3('contribution_soft', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using contribution_soft get API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function contribution_soft_get_example() {
+ $params = array(
+ 'id' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('contribution_soft', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function contribution_soft_get_expectedresult(){
+function contribution_soft_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'contribution_id' => '1',
- 'contact_id' => '4',
- 'amount' => '10.00',
- 'currency' => 'USD',
- 'pcp_display_in_roll' => 0,
- 'soft_credit_type_id' => '4',
- ),
+ 'id' => '1',
+ 'contribution_id' => '1',
+ 'contact_id' => '4',
+ 'amount' => '10.00',
+ 'currency' => 'USD',
+ 'pcp_display_in_roll' => 0,
+ 'soft_credit_type_id' => '4',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetContributionSoft and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetContributionSoft
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContributionSoftTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using country create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function country_create_example(){
-$params = array(
- 'name' => 'Made Up Land',
- 'iso_code' => 'ML',
- 'region_id' => 1,
-);
-try{
- $result = civicrm_api3('country', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using country create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function country_create_example() {
+ $params = array(
+ 'name' => 'Made Up Land',
+ 'iso_code' => 'ZZ',
+ 'region_id' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('country', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function country_create_expectedresult(){
+function country_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
- '1' => array(
- 'id' => '1',
- 'name' => 'Made Up Land',
- 'iso_code' => 'ML',
- 'country_code' => '',
- 'address_format_id' => '',
- 'idd_prefix' => '',
- 'ndd_prefix' => '',
- 'region_id' => '1',
- 'is_province_abbreviated' => '',
- ),
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1252,
+ 'values' => array(
+ '1252' => array(
+ 'id' => '1252',
+ 'name' => 'Made Up Land',
+ 'iso_code' => 'ZZ',
+ 'country_code' => '',
+ 'address_format_id' => '',
+ 'idd_prefix' => '',
+ 'ndd_prefix' => '',
+ 'region_id' => '1',
+ 'is_province_abbreviated' => '',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreateCountry and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreateCountry
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/CountryTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using country delete API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function country_delete_example(){
-$params = array(
- 'id' => 1,
-);
-try{
- $result = civicrm_api3('country', 'delete', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using country delete API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function country_delete_example() {
+ $params = array(
+ 'id' => 1253,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('country', 'delete', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function country_delete_expectedresult(){
+function country_delete_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'values' => 1,
-);
+ '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
-*
-* testDeleteCountry and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testDeleteCountry
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/CountryTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using country get API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function country_get_example(){
-$params = array(
- 'iso_code' => 'ML',
-);
-try{
- $result = civicrm_api3('country', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using country get API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function country_get_example() {
+ $params = array(
+ 'iso_code' => 'ZZ',
+ );
-return $result;
+ try{
+ $result = civicrm_api3('country', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function country_get_expectedresult(){
+function country_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
- '1' => array(
- 'id' => '1',
- 'name' => 'Made Up Land',
- 'iso_code' => 'ML',
- 'region_id' => '1',
- 'is_province_abbreviated' => 0,
- ),
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1254,
+ 'values' => array(
+ '1254' => array(
+ 'id' => '1254',
+ 'name' => 'Made Up Land',
+ 'iso_code' => 'ZZ',
+ 'region_id' => '1',
+ 'is_province_abbreviated' => 0,
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGet and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGet
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/CountryTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using custom_field create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function custom_field_create_example(){
-$params = array(
- 'custom_group_id' => 1,
- 'name' => 'test_textfield2',
- 'label' => 'Name1',
- 'html_type' => 'Text',
- 'data_type' => 'String',
- 'default_value' => 'abc',
- 'weight' => 4,
- 'is_required' => 1,
- 'is_searchable' => 0,
- 'is_active' => 1,
-);
-try{
- $result = civicrm_api3('custom_field', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using custom_field create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function custom_field_create_example() {
+ $params = array(
+ 'custom_group_id' => 1,
+ 'name' => 'test_textfield2',
+ 'label' => 'Name1',
+ 'html_type' => 'Text',
+ 'data_type' => 'String',
+ 'default_value' => 'abc',
+ 'weight' => 4,
+ 'is_required' => 1,
+ 'is_searchable' => 0,
+ 'is_active' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('custom_field', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function custom_field_create_expectedresult(){
+function custom_field_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'custom_group_id' => '1',
- 'name' => 'test_textfield2',
- 'label' => 'Name1',
- 'data_type' => 'String',
- 'html_type' => 'Text',
- 'default_value' => 'abc',
- 'is_required' => '1',
- 'is_searchable' => 0,
- 'is_search_range' => 0,
- 'weight' => '4',
- 'help_pre' => '',
- 'help_post' => '',
- 'mask' => '',
- 'attributes' => '',
- 'javascript' => '',
- 'is_active' => '1',
- 'is_view' => 0,
- 'options_per_line' => '',
- 'text_length' => '',
- 'start_date_years' => '',
- 'end_date_years' => '',
- 'date_format' => '',
- 'time_format' => '',
- 'note_columns' => '',
- 'note_rows' => '',
- 'column_name' => 'name1_1',
- 'option_group_id' => '',
- 'filter' => '',
- 'in_selector' => 0,
- ),
+ 'id' => '1',
+ 'custom_group_id' => '1',
+ 'name' => 'test_textfield2',
+ 'label' => 'Name1',
+ 'data_type' => 'String',
+ 'html_type' => 'Text',
+ 'default_value' => 'abc',
+ 'is_required' => '1',
+ 'is_searchable' => 0,
+ 'is_search_range' => 0,
+ 'weight' => '4',
+ 'help_pre' => '',
+ 'help_post' => '',
+ 'mask' => '',
+ 'attributes' => '',
+ 'javascript' => '',
+ 'is_active' => '1',
+ 'is_view' => 0,
+ 'options_per_line' => '',
+ 'text_length' => '',
+ 'start_date_years' => '',
+ 'end_date_years' => '',
+ 'date_format' => '',
+ 'time_format' => '',
+ 'note_columns' => '',
+ 'note_rows' => '',
+ 'column_name' => 'name1_1',
+ 'option_group_id' => '',
+ 'filter' => '',
+ 'in_selector' => 0,
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCustomFieldCreateWithEdit and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCustomFieldCreateWithEdit
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/CustomFieldTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using custom_field delete API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function custom_field_delete_example(){
-$params = array(
- 'id' => 1,
-);
-try{
- $result = civicrm_api3('custom_field', 'delete', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using custom_field delete API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function custom_field_delete_example() {
+ $params = array(
+ 'id' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('custom_field', 'delete', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function custom_field_delete_expectedresult(){
+function custom_field_delete_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'values' => 1,
-);
+ '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
-*
-* testCustomFieldDelete and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCustomFieldDelete
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/CustomFieldTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using custom_group create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function custom_group_create_example(){
-$params = array(
- 'title' => 'Test_Group_1',
- 'name' => 'test_group_1',
- 'extends' => array(
+
+/**
+ * Test Generated example of using custom_group create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function custom_group_create_example() {
+ $params = array(
+ 'title' => 'Test_Group_1',
+ 'name' => 'test_group_1',
+ 'extends' => array(
'0' => 'Individual',
),
- 'weight' => 4,
- 'collapse_display' => 1,
- 'style' => 'Inline',
- 'help_pre' => 'This is Pre Help For Test Group 1',
- 'help_post' => 'This is Post Help For Test Group 1',
- 'is_active' => 1,
-);
+ 'weight' => 4,
+ 'collapse_display' => 1,
+ 'style' => 'Inline',
+ 'help_pre' => 'This is Pre Help For Test Group 1',
+ 'help_post' => 'This is Post Help For Test Group 1',
+ 'is_active' => 1,
+ );
-try{
- $result = civicrm_api3('custom_group', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+ try{
+ $result = civicrm_api3('custom_group', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
-return $result;
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function custom_group_create_expectedresult(){
+function custom_group_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'name' => 'test_group_1',
- 'title' => 'Test_Group_1',
- 'extends' => 'Individual',
- 'extends_entity_column_id' => '',
- 'extends_entity_column_value' => '',
- 'style' => 'Inline',
- 'collapse_display' => '1',
- 'help_pre' => 'This is Pre Help For Test Group 1',
- 'help_post' => 'This is Post Help For Test Group 1',
- 'weight' => '2',
- 'is_active' => '1',
- 'table_name' => 'civicrm_value_test_group_1_1',
- 'is_multiple' => '',
- 'min_multiple' => '',
- 'max_multiple' => '',
- 'collapse_adv_display' => '',
- 'created_id' => '',
- 'created_date' => '',
- 'is_reserved' => '',
- ),
+ 'id' => '1',
+ 'name' => 'test_group_1',
+ 'title' => 'Test_Group_1',
+ 'extends' => 'Individual',
+ 'extends_entity_column_id' => '',
+ 'extends_entity_column_value' => '',
+ 'style' => 'Inline',
+ 'collapse_display' => '1',
+ 'help_pre' => 'This is Pre Help For Test Group 1',
+ 'help_post' => 'This is Post Help For Test Group 1',
+ 'weight' => '2',
+ 'is_active' => '1',
+ 'table_name' => 'civicrm_value_test_group_1_1',
+ 'is_multiple' => '',
+ 'min_multiple' => '',
+ 'max_multiple' => '',
+ 'collapse_adv_display' => '',
+ 'created_id' => '',
+ 'created_date' => '',
+ 'is_reserved' => '',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCustomGroupCreate and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCustomGroupCreate
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/CustomGroupTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using custom_group delete API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function custom_group_delete_example(){
-$params = array(
- 'id' => 1,
-);
-try{
- $result = civicrm_api3('custom_group', 'delete', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using custom_group delete API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function custom_group_delete_example() {
+ $params = array(
+ 'id' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('custom_group', 'delete', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function custom_group_delete_expectedresult(){
+function custom_group_delete_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'values' => 1,
-);
+ '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
-*
-* testCustomGroupDelete and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCustomGroupDelete
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/CustomGroupTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using custom_group get API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function custom_group_get_example(){
-$params = array();
-try{
- $result = civicrm_api3('custom_group', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using custom_group get API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function custom_group_get_example() {
+ $params = array();
-return $result;
+ try{
+ $result = civicrm_api3('custom_group', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function custom_group_get_expectedresult(){
+function custom_group_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'name' => 'test_group_1',
- 'title' => 'Test_Group_1',
- 'extends' => 'Individual',
- 'style' => 'Inline',
- 'collapse_display' => '1',
- 'help_pre' => 'This is Pre Help For Test Group 1',
- 'help_post' => 'This is Post Help For Test Group 1',
- 'weight' => '2',
- 'is_active' => '1',
- 'table_name' => 'civicrm_value_test_group_1_1',
- 'is_multiple' => 0,
- 'collapse_adv_display' => 0,
- 'is_reserved' => 0,
- ),
+ 'id' => '1',
+ 'name' => 'test_group_1',
+ 'title' => 'Test_Group_1',
+ 'extends' => 'Individual',
+ 'style' => 'Inline',
+ 'collapse_display' => '1',
+ 'help_pre' => 'This is Pre Help For Test Group 1',
+ 'help_post' => 'This is Post Help For Test Group 1',
+ 'weight' => '2',
+ 'is_active' => '1',
+ 'table_name' => 'civicrm_value_test_group_1_1',
+ 'is_multiple' => 0,
+ 'collapse_adv_display' => 0,
+ 'is_reserved' => 0,
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetCustomGroupSuccess and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetCustomGroupSuccess
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/CustomGroupTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using custom_value create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function custom_value_create_example(){
-$params = array(
- 'custom_1' => 'customString',
- 'entity_id' => 3,
-);
-try{
- $result = civicrm_api3('custom_value', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using custom_value create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function custom_value_create_example() {
+ $params = array(
+ 'custom_1' => 'customString',
+ 'entity_id' => 3,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('custom_value', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function custom_value_create_expectedresult(){
+function custom_value_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'values' => true,
-);
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'values' => TRUE,
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreateCustomValue and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreateCustomValue
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/CustomValueTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using custom_value get API
- * /*this demonstrates the use of CustomValue get *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function custom_value_get_example(){
-$params = array(
- 'id' => 2,
- 'entity_id' => 2,
-);
-try{
- $result = civicrm_api3('custom_value', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using custom_value get API.
+ *
+ * /*this demonstrates the use of CustomValue get
+ *
+ * @return array
+ * API result array
+ */
+function custom_value_get_example() {
+ $params = array(
+ 'id' => 2,
+ 'entity_id' => 2,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('custom_value', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function custom_value_get_expectedresult(){
+function custom_value_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 7,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 7,
+ 'values' => array(
'1' => array(
- 'entity_id' => '2',
- 'latest' => 'value 1',
- 'id' => '1',
- ),
+ 'entity_id' => '2',
+ 'latest' => 'value 1',
+ 'id' => '1',
+ ),
'2' => array(
- 'entity_id' => '2',
- 'latest' => 'value 3',
- 'id' => '2',
- '1' => 'value 2',
- '2' => 'value 3',
- ),
+ 'entity_id' => '2',
+ 'latest' => 'value 3',
+ 'id' => '2',
+ '1' => 'value 2',
+ '2' => 'value 3',
+ ),
'3' => array(
- 'entity_id' => '2',
- 'latest' => '',
- 'id' => '3',
- '1' => 'warm beer',
- '2' => '',
- ),
+ 'entity_id' => '2',
+ 'latest' => '',
+ 'id' => '3',
+ '1' => 'warm beer',
+ '2' => '',
+ ),
'4' => array(
- 'entity_id' => '2',
- 'latest' => '',
- 'id' => '4',
- '1' => 'fl* w*',
- '2' => '',
- ),
+ 'entity_id' => '2',
+ 'latest' => '',
+ 'id' => '4',
+ '1' => 'fl* w*',
+ '2' => '',
+ ),
'5' => array(
- 'entity_id' => '2',
- 'latest' => 'coffee',
- 'id' => '5',
- '1' => 'defaultValue',
- '2' => 'coffee',
- ),
+ 'entity_id' => '2',
+ 'latest' => 'coffee',
+ 'id' => '5',
+ '1' => 'defaultValue',
+ '2' => 'coffee',
+ ),
'6' => array(
- 'entity_id' => '2',
- 'latest' => 'value 4',
- 'id' => '6',
- '1' => '',
- '2' => 'value 4',
- ),
+ 'entity_id' => '2',
+ 'latest' => 'value 4',
+ 'id' => '6',
+ '1' => '',
+ '2' => 'value 4',
+ ),
'7' => array(
- 'entity_id' => '2',
- 'latest' => '',
- 'id' => '7',
- '1' => 'vegemite',
- '2' => '',
- ),
+ 'entity_id' => '2',
+ 'latest' => '',
+ 'id' => '7',
+ '1' => 'vegemite',
+ '2' => '',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetMultipleCustomValues and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetMultipleCustomValues
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/CustomValueTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using custom_value get API
- * utilises field names *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function custom_value_get_example(){
-$params = array(
- 'id' => 2,
- 'entity_id' => 2,
- 'format.field_names' => 1,
-);
-try{
- $result = civicrm_api3('custom_value', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using custom_value get API.
+ *
+ * utilises field names
+ *
+ * @return array
+ * API result array
+ */
+function custom_value_get_example() {
+ $params = array(
+ 'id' => 2,
+ 'entity_id' => 2,
+ 'format.field_names' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('custom_value', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function custom_value_get_expectedresult(){
+function custom_value_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 7,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 7,
+ 'values' => array(
'mySingleField' => array(
- 'entity_id' => '2',
- 'latest' => 'value 1',
- 'id' => 'mySingleField',
- ),
+ 'entity_id' => '2',
+ 'latest' => 'value 1',
+ 'id' => 'mySingleField',
+ ),
'field_12' => array(
- 'entity_id' => '2',
- 'latest' => 'value 3',
- 'id' => 'field_12',
- '1' => 'value 2',
- '2' => 'value 3',
- ),
+ 'entity_id' => '2',
+ 'latest' => 'value 3',
+ 'id' => 'field_12',
+ '1' => 'value 2',
+ '2' => 'value 3',
+ ),
'field_22' => array(
- 'entity_id' => '2',
- 'latest' => '',
- 'id' => 'field_22',
- '1' => 'warm beer',
- '2' => '',
- ),
+ 'entity_id' => '2',
+ 'latest' => '',
+ 'id' => 'field_22',
+ '1' => 'warm beer',
+ '2' => '',
+ ),
'field_32' => array(
- 'entity_id' => '2',
- 'latest' => '',
- 'id' => 'field_32',
- '1' => 'fl* w*',
- '2' => '',
- ),
+ 'entity_id' => '2',
+ 'latest' => '',
+ 'id' => 'field_32',
+ '1' => 'fl* w*',
+ '2' => '',
+ ),
'field_13' => array(
- 'entity_id' => '2',
- 'latest' => 'coffee',
- 'id' => 'field_13',
- '1' => 'defaultValue',
- '2' => 'coffee',
- ),
+ 'entity_id' => '2',
+ 'latest' => 'coffee',
+ 'id' => 'field_13',
+ '1' => 'defaultValue',
+ '2' => 'coffee',
+ ),
'field_23' => array(
- 'entity_id' => '2',
- 'latest' => 'value 4',
- 'id' => 'field_23',
- '1' => '',
- '2' => 'value 4',
- ),
+ 'entity_id' => '2',
+ 'latest' => 'value 4',
+ 'id' => 'field_23',
+ '1' => '',
+ '2' => 'value 4',
+ ),
'field_33' => array(
- 'entity_id' => '2',
- 'latest' => '',
- 'id' => 'field_33',
- '1' => 'vegemite',
- '2' => '',
- ),
+ 'entity_id' => '2',
+ 'latest' => '',
+ 'id' => 'field_33',
+ '1' => 'vegemite',
+ '2' => '',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetMultipleCustomValues and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetMultipleCustomValues
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/CustomValueTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using domain create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function domain_create_example(){
-$params = array(
- 'name' => 'A-team domain',
- 'description' => 'domain of chaos',
- 'domain_version' => '4.2',
- 'contact_id' => 6,
-);
-try{
- $result = civicrm_api3('domain', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using domain create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function domain_create_example() {
+ $params = array(
+ 'name' => 'A-team domain',
+ 'description' => 'domain of chaos',
+ 'domain_version' => '4.2',
+ 'contact_id' => 6,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('domain', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function domain_create_expectedresult(){
+function domain_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 3,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 3,
+ 'values' => array(
'3' => array(
- 'id' => '3',
- 'name' => 'A-team domain',
- 'description' => 'domain of chaos',
- 'config_backend' => '',
- 'version' => '4.2',
- 'contact_id' => '6',
- 'locales' => '',
- 'locale_custom_strings' => '',
- ),
+ 'id' => '3',
+ 'name' => 'A-team domain',
+ 'description' => 'domain of chaos',
+ 'config_backend' => '',
+ 'version' => '4.2',
+ 'contact_id' => '6',
+ 'locales' => '',
+ 'locale_custom_strings' => '',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreate and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreate
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/DomainTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using domain get API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function domain_get_example(){
-$params = array(
- 'sequential' => 1,
-);
-try{
- $result = civicrm_api3('domain', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using domain get API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function domain_get_example() {
+ $params = array(
+ 'sequential' => 1,
+ );
+
+ try{
+ $result = civicrm_api3('domain', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
-return $result;
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function domain_get_expectedresult(){
+function domain_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 2,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 2,
+ 'values' => array(
'0' => array(
- 'id' => '1',
- 'name' => 'Default Domain Name',
- 'config_backend' => 'a:83:{s:18:\"fatalErrorTemplate\";s:20:\"CRM/common/fatal.tpl\";s:15:\"civiRelativeURL\";s:13:\"/index.php?q=\";s:11:\"civiVersion\";s:9:\"4.5.beta9\";s:11:\"empoweredBy\";b:1;s:10:\"userSystem\";O:26:\"CRM_Utils_System_UnitTests\":5:{s:19:\"supports_UF_Logging\";b:1;s:9:\"is_drupal\";b:0;s:9:\"is_joomla\";b:0;s:12:\"is_wordpress\";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:12:\"versionCheck\";b:1;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',
- 'contact_id' => '3',
- 'locale_custom_strings' => 'a:1:{s:5:\"en_US\";a:0:{}}',
- 'domain_email' => 'my@email.com',
- 'domain_phone' => array(
- 'phone_type' => 'Phone',
- 'phone' => '456-456',
- ),
- 'domain_address' => array(
- 'street_address' => '45 Penny Lane',
- 'supplemental_address_1' => '',
- 'supplemental_address_2' => '',
- 'city' => '',
- 'state_province_id' => '',
- 'postal_code' => '',
- 'country_id' => '',
- 'geo_code_1' => '',
- 'geo_code_2' => '',
- ),
- 'from_email' => 'info@EXAMPLE.ORG',
- 'from_name' => 'FIXME',
+ '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.alpha1\";s:11:\"empoweredBy\";b:1;s:10:\"userSystem\";O:26:\"CRM_Utils_System_UnitTests\":5:{s:19:\"supports_UF_Logging\";b:1;s:9:\"is_drupal\";b:0;s:9:\"is_joomla\";b:0;s:12:\"is_wordpress\";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',
+ 'contact_id' => '3',
+ 'locale_custom_strings' => 'a:1:{s:5:\"en_US\";a:0:{}}',
+ 'domain_email' => 'my@email.com',
+ 'domain_phone' => array(
+ 'phone_type' => 'Phone',
+ 'phone' => '456-456',
),
+ 'domain_address' => array(
+ 'street_address' => '45 Penny Lane',
+ 'supplemental_address_1' => '',
+ 'supplemental_address_2' => '',
+ 'city' => '',
+ 'state_province_id' => '',
+ 'postal_code' => '',
+ 'country_id' => '',
+ 'geo_code_1' => '',
+ 'geo_code_2' => '',
+ ),
+ 'from_email' => 'info@EXAMPLE.ORG',
+ 'from_name' => 'FIXME',
+ ),
'1' => array(
- 'id' => '2',
- 'name' => 'Second Domain',
- 'config_backend' => 'a:83:{s:18:\"fatalErrorTemplate\";s:20:\"CRM/common/fatal.tpl\";s:15:\"civiRelativeURL\";s:13:\"/index.php?q=\";s:11:\"civiVersion\";s:9:\"4.5.beta9\";s:11:\"empoweredBy\";b:1;s:10:\"userSystem\";O:26:\"CRM_Utils_System_UnitTests\":5:{s:19:\"supports_UF_Logging\";b:1;s:9:\"is_drupal\";b:0;s:9:\"is_joomla\";b:0;s:12:\"is_wordpress\";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:12:\"versionCheck\";b:1;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>',
- 'domain_phone' => array(
- 'phone_type' => 'Phone',
- 'phone' => '204 555-1001',
- ),
- 'domain_address' => array(
- 'street_address' => '15 Main St',
- 'supplemental_address_1' => '',
- 'supplemental_address_2' => '',
- 'city' => 'Collinsville',
- 'state_province_id' => '1006',
- 'postal_code' => '6022',
- 'country_id' => '1228',
- 'geo_code_1' => '41.8328',
- 'geo_code_2' => '-72.9253',
- ),
- 'from_email' => 'info@EXAMPLE.ORG',
- 'from_name' => 'FIXME',
+ '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.alpha1\";s:11:\"empoweredBy\";b:1;s:10:\"userSystem\";O:26:\"CRM_Utils_System_UnitTests\":5:{s:19:\"supports_UF_Logging\";b:1;s:9:\"is_drupal\";b:0;s:9:\"is_joomla\";b:0;s:12:\"is_wordpress\";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>',
+ 'domain_phone' => array(
+ 'phone_type' => 'Phone',
+ 'phone' => '204 555-1001',
+ ),
+ 'domain_address' => array(
+ 'street_address' => '15 Main St',
+ 'supplemental_address_1' => '',
+ 'supplemental_address_2' => '',
+ 'city' => 'Collinsville',
+ 'state_province_id' => '1006',
+ 'postal_code' => '6022',
+ 'country_id' => '1228',
+ 'geo_code_1' => '41.8328',
+ 'geo_code_2' => '-72.9253',
),
+ 'from_email' => 'info@EXAMPLE.ORG',
+ 'from_name' => 'FIXME',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGet and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGet
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/DomainTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using email create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function email_create_example(){
-$params = array(
- 'contact_id' => 3,
- 'location_type_id' => 6,
- 'email' => 'api@a-team.com',
- 'is_primary' => 1,
-);
-try{
- $result = civicrm_api3('email', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using email create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function email_create_example() {
+ $params = array(
+ 'contact_id' => 3,
+ 'location_type_id' => 6,
+ 'email' => 'api@a-team.com',
+ 'is_primary' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('email', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function email_create_expectedresult(){
+function email_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 3,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 3,
+ 'values' => array(
'3' => array(
- 'id' => '3',
- 'contact_id' => '3',
- 'location_type_id' => '6',
- 'email' => 'api@a-team.com',
- 'is_primary' => '1',
- 'is_billing' => '',
- 'on_hold' => '',
- 'is_bulkmail' => '',
- 'hold_date' => '',
- 'reset_date' => '',
- 'signature_text' => '',
- 'signature_html' => '',
- ),
+ 'id' => '3',
+ 'contact_id' => '3',
+ 'location_type_id' => '6',
+ 'email' => 'api@a-team.com',
+ 'is_primary' => '1',
+ 'is_billing' => '',
+ 'on_hold' => '',
+ 'is_bulkmail' => '',
+ 'hold_date' => '',
+ 'reset_date' => '',
+ 'signature_text' => '',
+ 'signature_html' => '',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreateEmail and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreateEmail
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/EmailTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using email delete API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function email_delete_example(){
-$params = array(
- 'id' => 11,
-);
-try{
- $result = civicrm_api3('email', 'delete', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using email delete API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function email_delete_example() {
+ $params = array(
+ 'id' => 11,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('email', 'delete', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function email_delete_expectedresult(){
+function email_delete_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'values' => true,
-);
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'values' => TRUE,
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testDeleteEmail and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testDeleteEmail
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/EmailTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using email replace API
- * example demonstrates use of Replace in a nested API call *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function email_replace_example(){
-$params = array(
- 'id' => 10,
- 'api.email.replace' => array(
+
+/**
+ * Test Generated example of using email replace API.
+ *
+ * example demonstrates use of Replace in a nested API call
+ *
+ * @return array
+ * API result array
+ */
+function email_replace_example() {
+ $params = array(
+ 'id' => 10,
+ 'api.email.replace' => array(
'values' => array(
- '0' => array(
- 'location_type_id' => 20,
+ '0' => array(
+ 'location_type_id' => 20,
+ 'email' => '1-1@example.com',
+ 'is_primary' => 1,
+ ),
+ '1' => array(
+ 'location_type_id' => 20,
+ 'email' => '1-2@example.com',
+ 'is_primary' => 0,
+ ),
+ '2' => array(
+ 'location_type_id' => 20,
+ 'email' => '1-3@example.com',
+ 'is_primary' => 0,
+ ),
+ '3' => array(
+ 'location_type_id' => 21,
+ 'email' => '2-1@example.com',
+ 'is_primary' => 0,
+ ),
+ '4' => array(
+ 'location_type_id' => 21,
+ 'email' => '2-2@example.com',
+ 'is_primary' => 0,
+ ),
+ ),
+ ),
+ );
+
+ try{
+ $result = civicrm_api3('email', 'replace', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
+}
+
+/**
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
+ */
+function email_replace_expectedresult() {
+
+ $expectedResult = array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 10,
+ 'values' => array(
+ '10' => array(
+ 'contact_id' => '10',
+ 'contact_type' => 'Organization',
+ 'contact_sub_type' => '',
+ 'sort_name' => 'Unit Test Organization',
+ 'display_name' => 'Unit Test Organization',
+ 'do_not_email' => 0,
+ 'do_not_phone' => 0,
+ 'do_not_mail' => 0,
+ 'do_not_sms' => 0,
+ 'do_not_trade' => 0,
+ 'is_opt_out' => 0,
+ 'legal_identifier' => '',
+ 'external_identifier' => '',
+ 'nick_name' => '',
+ 'legal_name' => '',
+ 'image_URL' => '',
+ 'preferred_communication_method' => '',
+ 'preferred_language' => 'en_US',
+ 'preferred_mail_format' => 'Both',
+ 'first_name' => '',
+ 'middle_name' => '',
+ 'last_name' => '',
+ 'prefix_id' => '',
+ 'suffix_id' => '',
+ 'formal_title' => '',
+ 'communication_style_id' => '',
+ 'job_title' => '',
+ 'gender_id' => '',
+ 'birth_date' => '',
+ 'is_deceased' => 0,
+ 'deceased_date' => '',
+ 'household_name' => '',
+ 'organization_name' => 'Unit Test Organization',
+ 'sic_code' => '',
+ 'contact_is_deleted' => 0,
+ 'current_employer' => '',
+ 'address_id' => '',
+ 'street_address' => '',
+ 'supplemental_address_1' => '',
+ 'supplemental_address_2' => '',
+ 'city' => '',
+ 'postal_code_suffix' => '',
+ 'postal_code' => '',
+ 'geo_code_1' => '',
+ 'geo_code_2' => '',
+ 'state_province_id' => '',
+ 'country_id' => '',
+ 'phone_id' => '',
+ 'phone_type_id' => '',
+ 'phone' => '',
+ 'email_id' => '',
+ 'email' => '',
+ 'on_hold' => '',
+ 'im_id' => '',
+ 'provider_id' => '',
+ 'im' => '',
+ 'worldregion_id' => '',
+ 'world_region' => '',
+ 'individual_prefix' => '',
+ 'individual_suffix' => '',
+ 'communication_style' => '',
+ 'gender' => '',
+ 'state_province_name' => '',
+ 'state_province' => '',
+ 'country' => '',
+ 'id' => '10',
+ 'api.email.replace' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 5,
+ 'values' => array(
+ '0' => array(
+ 'id' => '18',
+ 'contact_id' => '10',
+ 'location_type_id' => '20',
'email' => '1-1@example.com',
- 'is_primary' => 1,
+ 'is_primary' => '1',
+ 'is_billing' => '',
+ 'on_hold' => '',
+ 'is_bulkmail' => '',
+ 'hold_date' => '',
+ 'reset_date' => '',
+ 'signature_text' => '',
+ 'signature_html' => '',
),
- '1' => array(
- 'location_type_id' => 20,
+ '1' => array(
+ 'id' => '19',
+ 'contact_id' => '10',
+ 'location_type_id' => '20',
'email' => '1-2@example.com',
'is_primary' => 0,
+ 'is_billing' => '',
+ 'on_hold' => '',
+ 'is_bulkmail' => '',
+ 'hold_date' => '',
+ 'reset_date' => '',
+ 'signature_text' => '',
+ 'signature_html' => '',
),
- '2' => array(
- 'location_type_id' => 20,
+ '2' => array(
+ 'id' => '20',
+ 'contact_id' => '10',
+ 'location_type_id' => '20',
'email' => '1-3@example.com',
'is_primary' => 0,
+ 'is_billing' => '',
+ 'on_hold' => '',
+ 'is_bulkmail' => '',
+ 'hold_date' => '',
+ 'reset_date' => '',
+ 'signature_text' => '',
+ 'signature_html' => '',
),
- '3' => array(
- 'location_type_id' => 21,
+ '3' => array(
+ 'id' => '21',
+ 'contact_id' => '10',
+ 'location_type_id' => '21',
'email' => '2-1@example.com',
'is_primary' => 0,
+ 'is_billing' => '',
+ 'on_hold' => '',
+ 'is_bulkmail' => '',
+ 'hold_date' => '',
+ 'reset_date' => '',
+ 'signature_text' => '',
+ 'signature_html' => '',
),
- '4' => array(
- 'location_type_id' => 21,
+ '4' => array(
+ 'id' => '22',
+ 'contact_id' => '10',
+ 'location_type_id' => '21',
'email' => '2-2@example.com',
'is_primary' => 0,
+ 'is_billing' => '',
+ 'on_hold' => '',
+ 'is_bulkmail' => '',
+ 'hold_date' => '',
+ 'reset_date' => '',
+ 'signature_text' => '',
+ 'signature_html' => '',
),
+ ),
),
+ ),
),
-);
-
-try{
- $result = civicrm_api3('email', 'replace', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
-
-return $result;
-}
-
-/**
- * Function returns array of result expected from previous function
- */
-function email_replace_expectedresult(){
-
- $expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 10,
- 'values' => array(
- '10' => array(
- 'contact_id' => '10',
- 'contact_type' => 'Organization',
- 'contact_sub_type' => '',
- 'sort_name' => 'Unit Test Organization',
- 'display_name' => 'Unit Test Organization',
- 'do_not_email' => 0,
- 'do_not_phone' => 0,
- 'do_not_mail' => 0,
- 'do_not_sms' => 0,
- 'do_not_trade' => 0,
- 'is_opt_out' => 0,
- 'legal_identifier' => '',
- 'external_identifier' => '',
- 'nick_name' => '',
- 'legal_name' => '',
- 'image_URL' => '',
- 'preferred_communication_method' => '',
- 'preferred_language' => 'en_US',
- 'preferred_mail_format' => 'Both',
- 'first_name' => '',
- 'middle_name' => '',
- 'last_name' => '',
- 'prefix_id' => '',
- 'suffix_id' => '',
- 'formal_title' => '',
- 'communication_style_id' => '',
- 'job_title' => '',
- 'gender_id' => '',
- 'birth_date' => '',
- 'is_deceased' => 0,
- 'deceased_date' => '',
- 'household_name' => '',
- 'organization_name' => 'Unit Test Organization',
- 'sic_code' => '',
- 'contact_is_deleted' => 0,
- 'current_employer' => '',
- 'address_id' => '',
- 'street_address' => '',
- 'supplemental_address_1' => '',
- 'supplemental_address_2' => '',
- 'city' => '',
- 'postal_code_suffix' => '',
- 'postal_code' => '',
- 'geo_code_1' => '',
- 'geo_code_2' => '',
- 'state_province_id' => '',
- 'country_id' => '',
- 'phone_id' => '',
- 'phone_type_id' => '',
- 'phone' => '',
- 'email_id' => '',
- 'email' => '',
- 'on_hold' => '',
- 'im_id' => '',
- 'provider_id' => '',
- 'im' => '',
- 'worldregion_id' => '',
- 'world_region' => '',
- 'individual_prefix' => '',
- 'individual_suffix' => '',
- 'communication_style' => '',
- 'gender' => '',
- 'state_province_name' => '',
- 'state_province' => '',
- 'country' => '',
- 'id' => '10',
- 'api.email.replace' => array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 5,
- 'values' => array(
- '0' => array(
- 'id' => '18',
- 'contact_id' => '10',
- 'location_type_id' => '20',
- 'email' => '1-1@example.com',
- 'is_primary' => '1',
- 'is_billing' => '',
- 'on_hold' => '',
- 'is_bulkmail' => '',
- 'hold_date' => '',
- 'reset_date' => '',
- 'signature_text' => '',
- 'signature_html' => '',
- ),
- '1' => array(
- 'id' => '19',
- 'contact_id' => '10',
- 'location_type_id' => '20',
- 'email' => '1-2@example.com',
- 'is_primary' => 0,
- 'is_billing' => '',
- 'on_hold' => '',
- 'is_bulkmail' => '',
- 'hold_date' => '',
- 'reset_date' => '',
- 'signature_text' => '',
- 'signature_html' => '',
- ),
- '2' => array(
- 'id' => '20',
- 'contact_id' => '10',
- 'location_type_id' => '20',
- 'email' => '1-3@example.com',
- 'is_primary' => 0,
- 'is_billing' => '',
- 'on_hold' => '',
- 'is_bulkmail' => '',
- 'hold_date' => '',
- 'reset_date' => '',
- 'signature_text' => '',
- 'signature_html' => '',
- ),
- '3' => array(
- 'id' => '21',
- 'contact_id' => '10',
- 'location_type_id' => '21',
- 'email' => '2-1@example.com',
- 'is_primary' => 0,
- 'is_billing' => '',
- 'on_hold' => '',
- 'is_bulkmail' => '',
- 'hold_date' => '',
- 'reset_date' => '',
- 'signature_text' => '',
- 'signature_html' => '',
- ),
- '4' => array(
- 'id' => '22',
- 'contact_id' => '10',
- 'location_type_id' => '21',
- 'email' => '2-2@example.com',
- 'is_primary' => 0,
- 'is_billing' => '',
- 'on_hold' => '',
- 'is_bulkmail' => '',
- 'hold_date' => '',
- 'reset_date' => '',
- 'signature_text' => '',
- 'signature_html' => '',
- ),
- ),
- ),
- ),
- ),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testReplaceEmailsInChain and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testReplaceEmailsInChain
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/EmailTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using email replace API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function email_replace_example(){
-$params = array(
- 'contact_id' => 9,
- 'values' => array(
+
+/**
+ * Test Generated example of using email replace API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function email_replace_example() {
+ $params = array(
+ 'contact_id' => 9,
+ 'values' => array(
'0' => array(
- 'location_type_id' => 18,
- 'email' => '1-1@example.com',
- 'is_primary' => 1,
- ),
+ 'location_type_id' => 18,
+ 'email' => '1-1@example.com',
+ 'is_primary' => 1,
+ ),
'1' => array(
- 'location_type_id' => 18,
- 'email' => '1-2@example.com',
- 'is_primary' => 0,
- ),
+ 'location_type_id' => 18,
+ 'email' => '1-2@example.com',
+ 'is_primary' => 0,
+ ),
'2' => array(
- 'location_type_id' => 18,
- 'email' => '1-3@example.com',
- 'is_primary' => 0,
- ),
+ 'location_type_id' => 18,
+ 'email' => '1-3@example.com',
+ 'is_primary' => 0,
+ ),
'3' => array(
- 'location_type_id' => 19,
- 'email' => '2-1@example.com',
- 'is_primary' => 0,
- ),
+ 'location_type_id' => 19,
+ 'email' => '2-1@example.com',
+ 'is_primary' => 0,
+ ),
'4' => array(
- 'location_type_id' => 19,
- 'email' => '2-2@example.com',
- 'is_primary' => 0,
- ),
+ 'location_type_id' => 19,
+ 'email' => '2-2@example.com',
+ 'is_primary' => 0,
+ ),
),
-);
+ );
-try{
- $result = civicrm_api3('email', 'replace', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+ try{
+ $result = civicrm_api3('email', 'replace', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
-return $result;
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function email_replace_expectedresult(){
+function email_replace_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 5,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 5,
+ 'values' => array(
'12' => array(
- 'id' => '12',
- 'contact_id' => '9',
- 'location_type_id' => '18',
- 'email' => '1-1@example.com',
- 'is_primary' => '1',
- 'is_billing' => '',
- 'on_hold' => '',
- 'is_bulkmail' => '',
- 'hold_date' => '',
- 'reset_date' => '',
- 'signature_text' => '',
- 'signature_html' => '',
- ),
+ 'id' => '12',
+ 'contact_id' => '9',
+ 'location_type_id' => '18',
+ 'email' => '1-1@example.com',
+ 'is_primary' => '1',
+ 'is_billing' => '',
+ 'on_hold' => '',
+ 'is_bulkmail' => '',
+ 'hold_date' => '',
+ 'reset_date' => '',
+ 'signature_text' => '',
+ 'signature_html' => '',
+ ),
'13' => array(
- 'id' => '13',
- 'contact_id' => '9',
- 'location_type_id' => '18',
- 'email' => '1-2@example.com',
- 'is_primary' => 0,
- 'is_billing' => '',
- 'on_hold' => '',
- 'is_bulkmail' => '',
- 'hold_date' => '',
- 'reset_date' => '',
- 'signature_text' => '',
- 'signature_html' => '',
- ),
+ 'id' => '13',
+ 'contact_id' => '9',
+ 'location_type_id' => '18',
+ 'email' => '1-2@example.com',
+ 'is_primary' => 0,
+ 'is_billing' => '',
+ 'on_hold' => '',
+ 'is_bulkmail' => '',
+ 'hold_date' => '',
+ 'reset_date' => '',
+ 'signature_text' => '',
+ 'signature_html' => '',
+ ),
'14' => array(
- 'id' => '14',
- 'contact_id' => '9',
- 'location_type_id' => '18',
- 'email' => '1-3@example.com',
- 'is_primary' => 0,
- 'is_billing' => '',
- 'on_hold' => '',
- 'is_bulkmail' => '',
- 'hold_date' => '',
- 'reset_date' => '',
- 'signature_text' => '',
- 'signature_html' => '',
- ),
+ 'id' => '14',
+ 'contact_id' => '9',
+ 'location_type_id' => '18',
+ 'email' => '1-3@example.com',
+ 'is_primary' => 0,
+ 'is_billing' => '',
+ 'on_hold' => '',
+ 'is_bulkmail' => '',
+ 'hold_date' => '',
+ 'reset_date' => '',
+ 'signature_text' => '',
+ 'signature_html' => '',
+ ),
'15' => array(
- 'id' => '15',
- 'contact_id' => '9',
- 'location_type_id' => '19',
- 'email' => '2-1@example.com',
- 'is_primary' => 0,
- 'is_billing' => '',
- 'on_hold' => '',
- 'is_bulkmail' => '',
- 'hold_date' => '',
- 'reset_date' => '',
- 'signature_text' => '',
- 'signature_html' => '',
- ),
+ 'id' => '15',
+ 'contact_id' => '9',
+ 'location_type_id' => '19',
+ 'email' => '2-1@example.com',
+ 'is_primary' => 0,
+ 'is_billing' => '',
+ 'on_hold' => '',
+ 'is_bulkmail' => '',
+ 'hold_date' => '',
+ 'reset_date' => '',
+ 'signature_text' => '',
+ 'signature_html' => '',
+ ),
'16' => array(
- 'id' => '16',
- 'contact_id' => '9',
- 'location_type_id' => '19',
- 'email' => '2-2@example.com',
- 'is_primary' => 0,
- 'is_billing' => '',
- 'on_hold' => '',
- 'is_bulkmail' => '',
- 'hold_date' => '',
- 'reset_date' => '',
- 'signature_text' => '',
- 'signature_html' => '',
- ),
+ 'id' => '16',
+ 'contact_id' => '9',
+ 'location_type_id' => '19',
+ 'email' => '2-2@example.com',
+ 'is_primary' => 0,
+ 'is_billing' => '',
+ 'on_hold' => '',
+ 'is_bulkmail' => '',
+ 'hold_date' => '',
+ 'reset_date' => '',
+ 'signature_text' => '',
+ 'signature_html' => '',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testReplaceEmail and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testReplaceEmail
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/EmailTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using entity_tag create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function entity_tag_create_example(){
-$params = array(
- 'contact_id' => 12,
- 'tag_id' => '1',
-);
-try{
- $result = civicrm_api3('entity_tag', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using entity_tag create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function entity_tag_create_example() {
+ $params = array(
+ 'contact_id' => 12,
+ 'tag_id' => '9',
+ );
-return $result;
+ try{
+ $result = civicrm_api3('entity_tag', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function entity_tag_create_expectedresult(){
+function entity_tag_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'not_added' => 0,
- 'added' => 1,
- 'total_count' => 1,
-);
+ 'is_error' => 0,
+ 'not_added' => 0,
+ 'added' => 1,
+ 'total_count' => 1,
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testContactEntityTagCreate and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testContactEntityTagCreate
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/EntityTagTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using entity_tag delete API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function entity_tag_delete_example(){
-$params = array(
- 'contact_id_h' => 37,
- 'tag_id' => '1',
-);
-try{
- $result = civicrm_api3('entity_tag', 'delete', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using entity_tag delete API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function entity_tag_delete_example() {
+ $params = array(
+ 'contact_id_h' => 37,
+ 'tag_id' => '17',
+ );
-return $result;
+ try{
+ $result = civicrm_api3('entity_tag', 'delete', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function entity_tag_delete_expectedresult(){
+function entity_tag_delete_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'not_removed' => 0,
- 'removed' => 1,
- 'total_count' => 1,
-);
+ 'is_error' => 0,
+ 'not_removed' => 0,
+ 'removed' => 1,
+ 'total_count' => 1,
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testEntityTagDeleteHH and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testEntityTagDeleteHH
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/EntityTagTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using entity_tag get API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function entity_tag_get_example(){
-$params = array(
- 'contact_id' => 21,
- 'tag_id' => '1',
-);
-try{
- $result = civicrm_api3('entity_tag', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using entity_tag get API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function entity_tag_get_example() {
+ $params = array(
+ 'contact_id' => 21,
+ 'tag_id' => '12',
+ );
-return $result;
+ try{
+ $result = civicrm_api3('entity_tag', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function entity_tag_get_expectedresult(){
+function entity_tag_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'not_added' => 0,
- 'added' => 1,
- 'total_count' => 1,
-);
+ 'is_error' => 0,
+ 'not_added' => 0,
+ 'added' => 1,
+ 'total_count' => 1,
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testIndividualEntityTagGet and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testIndividualEntityTagGet
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/EntityTagTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using event create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function event_create_example(){
-$params = array(
- 'title' => 'Annual CiviCRM meet',
- 'summary' => 'If you have any CiviCRM realted issues or want to track where CiviCRM is heading, Sign up now',
- 'description' => 'This event is intended to give brief idea about progess of CiviCRM and giving solutions to common user issues',
- 'event_type_id' => 1,
- 'is_public' => 1,
- 'start_date' => 20081021,
- 'end_date' => 20081023,
- 'is_online_registration' => 1,
- 'registration_start_date' => 20080601,
- 'registration_end_date' => '2008-10-15',
- 'max_participants' => 100,
- 'event_full_text' => 'Sorry! We are already full',
- 'is_monetary' => 0,
- 'is_active' => 1,
- 'is_show_location' => 0,
-);
-try{
- $result = civicrm_api3('event', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using event create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function event_create_example() {
+ $params = array(
+ 'title' => 'Annual CiviCRM meet',
+ 'summary' => 'If you have any CiviCRM realted issues or want to track where CiviCRM is heading, Sign up now',
+ 'description' => 'This event is intended to give brief idea about progess of CiviCRM and giving solutions to common user issues',
+ 'event_type_id' => 1,
+ 'is_public' => 1,
+ 'start_date' => 20081021,
+ 'end_date' => 20081023,
+ 'is_online_registration' => 1,
+ 'registration_start_date' => 20080601,
+ 'registration_end_date' => '2008-10-15',
+ 'max_participants' => 100,
+ 'event_full_text' => 'Sorry! We are already full',
+ 'is_monetary' => 0,
+ 'is_active' => 1,
+ 'is_show_location' => 0,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('event', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function event_create_expectedresult(){
+function event_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 3,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 3,
+ 'values' => array(
'3' => array(
- 'id' => '3',
- 'title' => 'Annual CiviCRM meet',
- 'summary' => 'If you have any CiviCRM realted issues or want to track where CiviCRM is heading, Sign up now',
- 'description' => 'This event is intended to give brief idea about progess of CiviCRM and giving solutions to common user issues',
- 'event_type_id' => '1',
- 'participant_listing_id' => '',
- 'is_public' => '1',
- 'start_date' => '2013-07-29 00:00:00',
- 'end_date' => '2013-08-04 00:00:00',
- 'is_online_registration' => '1',
- 'registration_link_text' => '',
- 'registration_start_date' => '20080601000000',
- 'registration_end_date' => '20081015000000',
- 'max_participants' => '100',
- 'event_full_text' => 'Sorry! We are already full',
- 'is_monetary' => 0,
- 'financial_type_id' => '',
- 'payment_processor' => '',
- 'is_map' => '',
- 'is_active' => '1',
- 'fee_label' => '',
- 'is_show_location' => 0,
- 'loc_block_id' => '',
- 'default_role_id' => '',
- 'intro_text' => '',
- 'footer_text' => '',
- 'confirm_title' => '',
- 'confirm_text' => '',
- 'confirm_footer_text' => '',
- 'is_email_confirm' => '',
- 'confirm_email_text' => '',
- 'confirm_from_name' => '',
- 'confirm_from_email' => '',
- 'cc_confirm' => '',
- 'bcc_confirm' => '',
- 'default_fee_id' => '',
- 'default_discount_fee_id' => '',
- 'thankyou_title' => '',
- 'thankyou_text' => '',
- 'thankyou_footer_text' => '',
- 'is_pay_later' => '',
- 'pay_later_text' => '',
- 'pay_later_receipt' => '',
- 'is_partial_payment' => '',
- 'initial_amount_label' => '',
- 'initial_amount_help_text' => '',
- 'min_initial_amount' => '',
- 'is_multiple_registrations' => '',
- 'allow_same_participant_emails' => '',
- 'has_waitlist' => '',
- 'requires_approval' => '',
- 'expiration_time' => '',
- 'waitlist_text' => '',
- 'approval_req_text' => '',
- 'is_template' => 0,
- 'template_title' => '',
- 'created_id' => '',
- 'created_date' => '2013-07-28 08:49:19',
- 'currency' => '',
- 'campaign_id' => '',
- 'is_share' => '',
- 'is_confirm_enabled' => '',
- 'parent_event_id' => '',
- 'slot_label_id' => '',
- 'dedupe_rule_group_id' => '',
- ),
+ 'id' => '3',
+ 'title' => 'Annual CiviCRM meet',
+ 'summary' => 'If you have any CiviCRM realted issues or want to track where CiviCRM is heading, Sign up now',
+ 'description' => 'This event is intended to give brief idea about progess of CiviCRM and giving solutions to common user issues',
+ 'event_type_id' => '1',
+ 'participant_listing_id' => '',
+ 'is_public' => '1',
+ 'start_date' => '2013-07-29 00:00:00',
+ 'end_date' => '2013-08-04 00:00:00',
+ 'is_online_registration' => '1',
+ 'registration_link_text' => '',
+ 'registration_start_date' => '20080601000000',
+ 'registration_end_date' => '20081015000000',
+ 'max_participants' => '100',
+ 'event_full_text' => 'Sorry! We are already full',
+ 'is_monetary' => 0,
+ 'financial_type_id' => '',
+ 'payment_processor' => '',
+ 'is_map' => '',
+ 'is_active' => '1',
+ 'fee_label' => '',
+ 'is_show_location' => 0,
+ 'loc_block_id' => '',
+ 'default_role_id' => '',
+ 'intro_text' => '',
+ 'footer_text' => '',
+ 'confirm_title' => '',
+ 'confirm_text' => '',
+ 'confirm_footer_text' => '',
+ 'is_email_confirm' => '',
+ 'confirm_email_text' => '',
+ 'confirm_from_name' => '',
+ 'confirm_from_email' => '',
+ 'cc_confirm' => '',
+ 'bcc_confirm' => '',
+ 'default_fee_id' => '',
+ 'default_discount_fee_id' => '',
+ 'thankyou_title' => '',
+ 'thankyou_text' => '',
+ 'thankyou_footer_text' => '',
+ 'is_pay_later' => '',
+ 'pay_later_text' => '',
+ 'pay_later_receipt' => '',
+ 'is_partial_payment' => '',
+ 'initial_amount_label' => '',
+ 'initial_amount_help_text' => '',
+ 'min_initial_amount' => '',
+ 'is_multiple_registrations' => '',
+ 'allow_same_participant_emails' => '',
+ 'has_waitlist' => '',
+ 'requires_approval' => '',
+ 'expiration_time' => '',
+ 'waitlist_text' => '',
+ 'approval_req_text' => '',
+ 'is_template' => 0,
+ 'template_title' => '',
+ 'created_id' => '',
+ 'created_date' => '2013-07-28 08:49:19',
+ 'currency' => '',
+ 'campaign_id' => '',
+ 'is_share' => '',
+ 'is_confirm_enabled' => '',
+ 'parent_event_id' => '',
+ 'slot_label_id' => '',
+ 'dedupe_rule_group_id' => '',
+ 'is_billing_required' => '',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreateEventSuccess and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreateEventSuccess
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/EventTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using event delete API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function event_delete_example(){
-$params = array(
- 'id' => 1,
-);
-try{
- $result = civicrm_api3('event', 'delete', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using event delete API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function event_delete_example() {
+ $params = array(
+ 'id' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('event', 'delete', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function event_delete_expectedresult(){
+function event_delete_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'values' => 1,
-);
+ '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
-*
-* testDelete and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testDelete
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/EventTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using event get API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function event_get_example(){
-$params = array(
- 'event_title' => 'Annual CiviCRM meet',
- 'sequential' => true,
-);
-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('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using event get API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function event_get_example() {
+ $params = array(
+ 'event_title' => 'Annual CiviCRM meet',
+ 'sequential' => TRUE,
+ );
-return $result;
+ 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(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function event_get_expectedresult(){
+function event_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'0' => array(
- 'id' => '1',
- 'title' => 'Annual CiviCRM meet',
- 'event_title' => 'Annual CiviCRM meet',
- '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',
- '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,
- 'allow_same_participant_emails' => 0,
- 'is_template' => 0,
- 'created_date' => '2013-07-28 08:49:19',
- 'is_share' => '1',
- 'is_confirm_enabled' => '1',
- ),
+ 'id' => '1',
+ 'title' => 'Annual CiviCRM meet',
+ 'event_title' => 'Annual CiviCRM meet',
+ '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',
+ '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,
+ 'allow_same_participant_emails' => 0,
+ 'is_template' => 0,
+ 'created_date' => '2013-07-28 08:49:19',
+ 'is_share' => '1',
+ 'is_confirm_enabled' => '1',
+ 'is_billing_required' => 0,
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetEventByEventTitle and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetEventByEventTitle
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/EventTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using event get API
- * demonstrates use of is.Current option *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function event_get_example(){
-$params = array(
- 'isCurrent' => 1,
-);
-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('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using event get API.
+ *
+ * demonstrates use of is.Current option
+ *
+ * @return array
+ * API result array
+ */
+function event_get_example() {
+ $params = array(
+ 'isCurrent' => 1,
+ );
-return $result;
+ 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(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function event_get_expectedresult(){
+function event_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 3,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 3,
+ 'values' => array(
'3' => array(
- 'id' => '3',
- 'title' => 'Annual CiviCRM meet 2',
- 'event_title' => 'Annual CiviCRM meet 2',
- 'summary' => 'If you have any CiviCRM realted issues or want to track where CiviCRM is heading, Sign up now',
- 'description' => 'This event is intended to give brief idea about progess of CiviCRM and giving solutions to common user issues',
- 'event_description' => 'This event is intended to give brief idea about progess of CiviCRM and giving solutions to common user issues',
- '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',
- 'end_date' => '2013-08-04 00:00:00',
- 'event_end_date' => '2013-08-04 00:00:00',
- 'is_online_registration' => '1',
- 'registration_start_date' => '2010-06-01 00:00:00',
- 'registration_end_date' => '2010-10-15 00:00:00',
- 'max_participants' => '100',
- 'event_full_text' => 'Sorry! We are already full',
- 'is_monetary' => 0,
- 'is_map' => 0,
- 'is_active' => '1',
- 'is_show_location' => 0,
- 'default_role_id' => '1',
- 'is_email_confirm' => 0,
- 'is_pay_later' => 0,
- 'is_partial_payment' => 0,
- 'is_multiple_registrations' => 0,
- 'allow_same_participant_emails' => 0,
- 'is_template' => 0,
- 'created_date' => '2013-07-28 08:49:19',
- 'is_share' => '1',
- 'is_confirm_enabled' => '1',
- ),
+ 'id' => '3',
+ 'title' => 'Annual CiviCRM meet 2',
+ 'event_title' => 'Annual CiviCRM meet 2',
+ 'summary' => 'If you have any CiviCRM realted issues or want to track where CiviCRM is heading, Sign up now',
+ 'description' => 'This event is intended to give brief idea about progess of CiviCRM and giving solutions to common user issues',
+ 'event_description' => 'This event is intended to give brief idea about progess of CiviCRM and giving solutions to common user issues',
+ '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',
+ 'end_date' => '2013-08-04 00:00:00',
+ 'event_end_date' => '2013-08-04 00:00:00',
+ 'is_online_registration' => '1',
+ 'registration_start_date' => '2010-06-01 00:00:00',
+ 'registration_end_date' => '2010-10-15 00:00:00',
+ 'max_participants' => '100',
+ 'event_full_text' => 'Sorry! We are already full',
+ 'is_monetary' => 0,
+ 'is_map' => 0,
+ 'is_active' => '1',
+ 'is_show_location' => 0,
+ 'default_role_id' => '1',
+ 'is_email_confirm' => 0,
+ 'is_pay_later' => 0,
+ 'is_partial_payment' => 0,
+ 'is_multiple_registrations' => 0,
+ 'allow_same_participant_emails' => 0,
+ 'is_template' => 0,
+ 'created_date' => '2013-07-28 08:49:19',
+ 'is_share' => '1',
+ 'is_confirm_enabled' => '1',
+ 'is_billing_required' => 0,
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetIsCurrent and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetIsCurrent
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/EventTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using event getsingle API
- * demonstrates use of return is_full *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function event_getsingle_example(){
-$params = array(
- 'id' => 1,
- 'return.is_full' => 1,
-);
-try{
- $result = civicrm_api3('event', 'getsingle', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using event getsingle API.
+ *
+ * demonstrates use of return is_full
+ *
+ * @return array
+ * API result array
+ */
+function event_getsingle_example() {
+ $params = array(
+ 'id' => 1,
+ 'return.is_full' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('event', 'getsingle', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function event_getsingle_expectedresult(){
+function event_getsingle_expectedresult() {
$expectedResult = array(
- 'id' => '1',
- 'title' => 'Annual CiviCRM meet',
- 'event_title' => 'Annual CiviCRM meet',
- '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',
- 'is_online_registration' => 0,
- 'max_participants' => '1',
- '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,
- 'allow_same_participant_emails' => 0,
- 'is_template' => 0,
- 'created_date' => '2014-09-28 23:20:52',
- 'is_share' => '1',
- 'is_confirm_enabled' => '1',
- 'available_places' => 0,
- 'is_full' => '1',
-);
+ 'id' => '1',
+ 'title' => 'Annual CiviCRM meet',
+ 'event_title' => 'Annual CiviCRM meet',
+ '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',
+ 'is_online_registration' => 0,
+ 'max_participants' => '1',
+ '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,
+ 'allow_same_participant_emails' => 0,
+ 'is_template' => 0,
+ 'created_date' => '2015-01-15 02:10:12',
+ 'is_share' => '1',
+ 'is_confirm_enabled' => '1',
+ 'is_billing_required' => 0,
+ 'available_places' => 0,
+ 'is_full' => '1',
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetSingleReturnIsFull and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetSingleReturnIsFull
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/EventTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using grant create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function grant_create_example(){
-$params = array(
- 'contact_id' => 3,
- 'application_received_date' => 'now',
- 'decision_date' => 'next Monday',
- 'amount_total' => '500',
- 'status_id' => 1,
- 'rationale' => 'Just Because',
- 'currency' => 'USD',
- 'grant_type_id' => 1,
-);
-try{
- $result = civicrm_api3('grant', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using grant create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function grant_create_example() {
+ $params = array(
+ 'contact_id' => 3,
+ 'application_received_date' => 'now',
+ 'decision_date' => 'next Monday',
+ 'amount_total' => '500',
+ 'status_id' => 1,
+ 'rationale' => 'Just Because',
+ 'currency' => 'USD',
+ 'grant_type_id' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('grant', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function grant_create_expectedresult(){
+function grant_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'contact_id' => '3',
- 'application_received_date' => '20130728084957',
- 'decision_date' => '20130805000000',
- 'money_transfer_date' => '',
- 'grant_due_date' => '',
- 'grant_report_received' => '',
- 'grant_type_id' => '1',
- 'amount_total' => '500',
- 'amount_requested' => '',
- 'amount_granted' => '',
- 'currency' => 'USD',
- 'rationale' => 'Just Because',
- 'status_id' => '1',
- 'financial_type_id' => '',
- ),
+ 'id' => '1',
+ 'contact_id' => '3',
+ 'application_received_date' => '20130728084957',
+ 'decision_date' => '20130805000000',
+ 'money_transfer_date' => '',
+ 'grant_due_date' => '',
+ 'grant_report_received' => '',
+ 'grant_type_id' => '1',
+ 'amount_total' => '500',
+ 'amount_requested' => '',
+ 'amount_granted' => '',
+ 'currency' => 'USD',
+ 'rationale' => 'Just Because',
+ 'status_id' => '1',
+ 'financial_type_id' => '',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreateGrant and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreateGrant
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/GrantTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using grant delete API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function grant_delete_example(){
-$params = array(
- 'id' => 1,
-);
-try{
- $result = civicrm_api3('grant', 'delete', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using grant delete API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function grant_delete_example() {
+ $params = array(
+ 'id' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('grant', 'delete', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function grant_delete_expectedresult(){
+function grant_delete_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'values' => true,
-);
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'values' => TRUE,
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testDeleteGrant and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testDeleteGrant
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/GrantTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using grant get API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function grant_get_example(){
-$params = array(
- 'rationale' => 'Just Because',
-);
-try{
- $result = civicrm_api3('grant', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using grant get API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function grant_get_example() {
+ $params = array(
+ 'rationale' => 'Just Because',
+ );
-return $result;
+ try{
+ $result = civicrm_api3('grant', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function grant_get_expectedresult(){
+function grant_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'contact_id' => '5',
- 'application_received_date' => '20130728084957',
- 'decision_date' => '20130805000000',
- 'grant_type_id' => '1',
- 'amount_total' => '500.00',
- 'currency' => 'USD',
- 'rationale' => 'Just Because',
- 'status_id' => '1',
- ),
+ 'id' => '1',
+ 'contact_id' => '5',
+ 'application_received_date' => '20130728084957',
+ 'decision_date' => '20130805000000',
+ 'grant_type_id' => '1',
+ 'amount_total' => '500.00',
+ 'currency' => 'USD',
+ 'rationale' => 'Just Because',
+ 'status_id' => '1',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetGrant and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetGrant
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/GrantTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using group get API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function group_get_example(){
-$params = array(
- 'name' => 'Test Group 1',
-);
-try{
- $result = civicrm_api3('group', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using group get API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function group_get_example() {
+ $params = array(
+ 'name' => 'Test Group 1',
+ );
-return $result;
+ try{
+ $result = civicrm_api3('group', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function group_get_expectedresult(){
+function group_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 4,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 4,
+ 'values' => array(
'4' => array(
- 'id' => '4',
- 'name' => 'Test Group 1',
- 'title' => 'New Test Group Created',
- '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 ) )\";}',
- 'group_type' => array(
- '0' => '1',
- '1' => '2',
- ),
- 'is_hidden' => 0,
- 'is_reserved' => 0,
+ 'id' => '4',
+ 'name' => 'Test Group 1',
+ 'title' => 'New Test Group Created',
+ '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 ) )\";}',
+ 'group_type' => array(
+ '0' => '1',
+ '1' => '2',
),
+ 'is_hidden' => 0,
+ 'is_reserved' => 0,
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetGroupParamsWithGroupName and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetGroupParamsWithGroupName
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/GroupTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using group getfields API
- * demonstrate use of getfields to interrogate api *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function group_getfields_example(){
-$params = array(
- 'action' => 'create',
-);
-try{
- $result = civicrm_api3('group', 'getfields', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using group getfields API.
+ *
+ * demonstrate use of getfields to interrogate api
+ *
+ * @return array
+ * API result array
+ */
+function group_getfields_example() {
+ $params = array(
+ 'action' => 'create',
+ );
-return $result;
+ try{
+ $result = civicrm_api3('group', 'getfields', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function group_getfields_expectedresult(){
+function group_getfields_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 20,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 20,
+ 'values' => array(
'id' => array(
- 'name' => 'id',
- 'type' => 1,
- 'title' => 'Group ID',
- 'required' => true,
- 'api.aliases' => array(
- '0' => 'group_id',
- ),
- ),
+ 'name' => 'id',
+ 'type' => 1,
+ 'title' => 'Group ID',
+ 'required' => TRUE,
+ 'api.aliases' => array(
+ '0' => 'group_id',
+ ),
+ ),
'name' => array(
- 'name' => 'name',
- 'type' => 2,
- 'title' => 'Group Name',
- 'maxlength' => 64,
- 'size' => 30,
- ),
+ 'name' => 'name',
+ 'type' => 2,
+ 'title' => 'Group Name',
+ 'maxlength' => 64,
+ 'size' => 30,
+ ),
'title' => array(
- 'name' => 'title',
- 'type' => 2,
- 'title' => 'Group Title',
- 'maxlength' => 64,
- 'size' => 30,
- 'api.required' => 1,
- ),
+ 'name' => 'title',
+ 'type' => 2,
+ 'title' => 'Group Title',
+ 'maxlength' => 64,
+ 'size' => 30,
+ 'api.required' => 1,
+ ),
'description' => array(
- 'name' => 'description',
- 'type' => 32,
- 'title' => 'Group Description',
- 'rows' => 2,
- 'cols' => 60,
- 'html' => array(
- 'type' => 'TextArea',
- ),
- ),
+ 'name' => 'description',
+ 'type' => 32,
+ 'title' => 'Group Description',
+ 'rows' => 2,
+ 'cols' => 60,
+ 'html' => array(
+ 'type' => 'TextArea',
+ ),
+ ),
'source' => array(
- 'name' => 'source',
- 'type' => 2,
- 'title' => 'Group Source',
- 'maxlength' => 64,
- 'size' => 30,
- ),
+ 'name' => 'source',
+ 'type' => 2,
+ 'title' => 'Group Source',
+ 'maxlength' => 64,
+ 'size' => 30,
+ ),
'saved_search_id' => array(
- 'name' => 'saved_search_id',
- 'type' => 1,
- 'title' => 'Saved Search ID',
- 'FKClassName' => 'CRM_Contact_DAO_SavedSearch',
- ),
+ 'name' => 'saved_search_id',
+ 'type' => 1,
+ 'title' => 'Saved Search ID',
+ 'FKClassName' => 'CRM_Contact_DAO_SavedSearch',
+ 'FKApiName' => 'SavedSearch',
+ ),
'is_active' => array(
- 'name' => 'is_active',
- 'type' => 16,
- 'title' => 'Group Enabled',
- 'api.default' => 1,
- ),
+ 'name' => 'is_active',
+ 'type' => 16,
+ 'title' => 'Group Enabled',
+ 'api.default' => 1,
+ ),
'visibility' => array(
- 'name' => 'visibility',
- 'type' => 2,
- 'title' => 'Group Visibility Setting',
- 'maxlength' => 24,
- 'size' => 20,
- 'default' => 'User and User Admin Only',
- 'html' => array(
- 'type' => 'Select',
- ),
- 'pseudoconstant' => array(
- 'callback' => 'CRM_Core_SelectValues::groupVisibility',
- ),
- ),
+ 'name' => 'visibility',
+ 'type' => 2,
+ 'title' => 'Group Visibility Setting',
+ 'maxlength' => 24,
+ 'size' => 20,
+ 'default' => 'User and User Admin Only',
+ 'html' => array(
+ 'type' => 'Select',
+ ),
+ 'pseudoconstant' => array(
+ 'callback' => 'CRM_Core_SelectValues::groupVisibility',
+ ),
+ ),
'where_clause' => array(
- 'name' => 'where_clause',
- 'type' => 32,
- 'title' => 'Group Where Clause',
- ),
+ 'name' => 'where_clause',
+ 'type' => 32,
+ 'title' => 'Group Where Clause',
+ ),
'select_tables' => array(
- 'name' => 'select_tables',
- 'type' => 32,
- 'title' => 'Tables For Select Clause',
- ),
+ 'name' => 'select_tables',
+ 'type' => 32,
+ 'title' => 'Tables For Select Clause',
+ ),
'where_tables' => array(
- 'name' => 'where_tables',
- 'type' => 32,
- 'title' => 'Tables For Where Clause',
- ),
+ 'name' => 'where_tables',
+ 'type' => 32,
+ 'title' => 'Tables For Where Clause',
+ ),
'group_type' => array(
- 'name' => 'group_type',
- 'type' => 2,
- 'title' => 'Group Type',
- 'maxlength' => 128,
- 'size' => 45,
- ),
+ 'name' => 'group_type',
+ 'type' => 2,
+ 'title' => 'Group Type',
+ 'maxlength' => 128,
+ 'size' => 45,
+ ),
'cache_date' => array(
- 'name' => 'cache_date',
- 'type' => 12,
- 'title' => 'Group Cache Date',
- ),
+ 'name' => 'cache_date',
+ 'type' => 12,
+ 'title' => 'Group Cache Date',
+ ),
'refresh_date' => array(
- 'name' => 'refresh_date',
- 'type' => 12,
- 'title' => 'Next Group Refresh Time',
- ),
+ 'name' => 'refresh_date',
+ 'type' => 12,
+ 'title' => 'Next Group Refresh Time',
+ ),
'parents' => array(
- 'name' => 'parents',
- 'type' => 32,
- 'title' => 'Group Parents',
- ),
+ 'name' => 'parents',
+ 'type' => 32,
+ 'title' => 'Group Parents',
+ ),
'children' => array(
- 'name' => 'children',
- 'type' => 32,
- 'title' => 'Group Children',
- ),
+ 'name' => 'children',
+ 'type' => 32,
+ 'title' => 'Group Children',
+ ),
'is_hidden' => array(
- 'name' => 'is_hidden',
- 'type' => 16,
- 'title' => 'Group is Hidden',
- ),
+ 'name' => 'is_hidden',
+ 'type' => 16,
+ 'title' => 'Group is Hidden',
+ ),
'is_reserved' => array(
- 'name' => 'is_reserved',
- 'type' => 16,
- 'title' => 'Group is Reserved',
- ),
+ 'name' => 'is_reserved',
+ 'type' => 16,
+ 'title' => 'Group is Reserved',
+ ),
'created_id' => array(
- 'name' => 'created_id',
- 'type' => 1,
- 'title' => 'Group Created By',
- 'FKClassName' => 'CRM_Contact_DAO_Contact',
- ),
+ 'name' => 'created_id',
+ 'type' => 1,
+ 'title' => 'Group Created By',
+ 'FKClassName' => 'CRM_Contact_DAO_Contact',
+ 'FKApiName' => 'Contact',
+ ),
'modified_id' => array(
- 'name' => 'modified_id',
- 'type' => 1,
- 'title' => 'Group Modified By',
- 'FKClassName' => 'CRM_Contact_DAO_Contact',
- ),
+ 'name' => 'modified_id',
+ 'type' => 1,
+ 'title' => 'Group Modified By',
+ 'FKClassName' => 'CRM_Contact_DAO_Contact',
+ 'FKApiName' => 'Contact',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testgetfields and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testgetfields
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/GroupTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using group_contact create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function group_contact_create_example(){
-$params = array(
- 'contact_id' => 1,
- 'contact_id.2' => 2,
- 'group_id' => 1,
-);
-try{
- $result = civicrm_api3('group_contact', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using group_contact create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function group_contact_create_example() {
+ $params = array(
+ 'contact_id' => 8,
+ 'contact_id.2' => 9,
+ 'group_id' => 11,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('group_contact', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function group_contact_create_expectedresult(){
+function group_contact_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'values' => 1,
- 'total_count' => 2,
- 'added' => 1,
- 'not_added' => 1,
-);
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'values' => 1,
+ 'total_count' => 2,
+ 'added' => 1,
+ 'not_added' => 1,
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreate and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreate
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/GroupContactTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using group_contact delete API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function group_contact_delete_example(){
-$params = array(
- 'id' => 4,
- 'skip_undelete' => true,
-);
-try{
- $result = civicrm_api3('group_contact', 'delete', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using group_contact delete API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function group_contact_delete_example() {
+ $params = array(
+ 'id' => 9,
+ 'skip_undelete' => TRUE,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('group_contact', 'delete', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function group_contact_delete_expectedresult(){
+function group_contact_delete_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'values' => 1,
- 'total_count' => 1,
- 'removed' => 0,
- 'not_removed' => 0,
-);
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'values' => 1,
+ 'total_count' => 1,
+ 'removed' => 0,
+ 'not_removed' => 0,
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testDeletePermanent and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testDeletePermanent
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/GroupContactTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using group_contact get API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function group_contact_get_example(){
-$params = array(
- 'contact_id' => 3,
-);
-try{
- $result = civicrm_api3('group_contact', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using group_contact get API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function group_contact_get_example() {
+ $params = array(
+ 'contact_id' => 3,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('group_contact', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function group_contact_get_expectedresult(){
+function group_contact_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'group_id' => '1',
- 'title' => 'New Test Group Created',
- 'visibility' => 'Public Pages',
- 'is_hidden' => 0,
- 'in_date' => '2013-07-28 08:50:19',
- 'in_method' => 'API',
- ),
+ 'id' => '1',
+ 'group_id' => '1',
+ 'title' => 'New Test Group Created',
+ 'visibility' => 'Public Pages',
+ 'is_hidden' => 0,
+ 'in_date' => '2013-07-28 08:50:19',
+ 'in_method' => 'API',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGet and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGet
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/GroupContactTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using group_contact get API
- * Get all from group and display contacts *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function group_contact_get_example(){
-$params = array(
- 'group_id' => 1,
- 'api.group.get' => 1,
- 'sequential' => 1,
-);
-try{
- $result = civicrm_api3('group_contact', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using group_contact get API.
+ *
+ * Get all from group and display contacts
+ *
+ * @return array
+ * API result array
+ */
+function group_contact_get_example() {
+ $params = array(
+ 'group_id' => 3,
+ 'api.group.get' => 1,
+ 'sequential' => 1,
+ );
+
+ try{
+ $result = civicrm_api3('group_contact', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
-return $result;
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function group_contact_get_expectedresult(){
+function group_contact_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 2,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 2,
+ 'values' => array(
'0' => array(
- 'id' => '1',
- 'group_id' => '1',
- 'contact_id' => '3',
- 'status' => 'Added',
- 'api.group.get' => array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
- '0' => array(
- 'id' => '1',
- 'name' => 'Test Group 1',
- 'title' => 'New Test Group Created',
- 'description' => 'New Test Group Created',
- 'is_active' => '1',
- 'visibility' => 'Public Pages',
- 'where_clause' => ' ( `civicrm_group_contact-1`.group_id IN ( 1 ) AND `civicrm_group_contact-1`.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-1`\";s:165:\" LEFT JOIN civicrm_group_contact `civicrm_group_contact-1` ON ( contact_a.id = `civicrm_group_contact-1`.contact_id AND `civicrm_group_contact-1`.group_id IN ( 1 ) )\";}',
- 'where_tables' => 'a:2:{s:15:\"civicrm_contact\";i:1;s:25:\"`civicrm_group_contact-1`\";s:165:\" LEFT JOIN civicrm_group_contact `civicrm_group_contact-1` ON ( contact_a.id = `civicrm_group_contact-1`.contact_id AND `civicrm_group_contact-1`.group_id IN ( 1 ) )\";}',
- 'group_type' => array(
- '0' => '1',
- '1' => '2',
- ),
- 'is_hidden' => 0,
- 'is_reserved' => 0,
- ),
- ),
- ),
- ),
- '1' => array(
- 'id' => '2',
- 'group_id' => '1',
- 'contact_id' => '1',
- 'status' => 'Added',
- 'api.group.get' => array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
- '0' => array(
- 'id' => '1',
- 'name' => 'Test Group 1',
- 'title' => 'New Test Group Created',
- 'description' => 'New Test Group Created',
- 'is_active' => '1',
- 'visibility' => 'Public Pages',
- 'where_clause' => ' ( `civicrm_group_contact-1`.group_id IN ( 1 ) AND `civicrm_group_contact-1`.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-1`\";s:165:\" LEFT JOIN civicrm_group_contact `civicrm_group_contact-1` ON ( contact_a.id = `civicrm_group_contact-1`.contact_id AND `civicrm_group_contact-1`.group_id IN ( 1 ) )\";}',
- 'where_tables' => 'a:2:{s:15:\"civicrm_contact\";i:1;s:25:\"`civicrm_group_contact-1`\";s:165:\" LEFT JOIN civicrm_group_contact `civicrm_group_contact-1` ON ( contact_a.id = `civicrm_group_contact-1`.contact_id AND `civicrm_group_contact-1`.group_id IN ( 1 ) )\";}',
- 'group_type' => array(
- '0' => '1',
- '1' => '2',
- ),
- 'is_hidden' => 0,
- 'is_reserved' => 0,
- ),
- ),
+ 'id' => '2',
+ 'group_id' => '3',
+ 'contact_id' => '4',
+ 'status' => 'Added',
+ 'api.group.get' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 3,
+ 'values' => array(
+ '0' => array(
+ 'id' => '3',
+ 'name' => 'Test Group 1',
+ 'title' => 'New Test Group Created',
+ '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 ) )\";}',
+ 'group_type' => array(
+ '0' => '1',
+ '1' => '2',
+ ),
+ 'is_hidden' => 0,
+ 'is_reserved' => 0,
),
+ ),
),
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetGroupID and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetGroupID
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/GroupContactTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using group_nesting create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function group_nesting_create_example(){
-$params = array(
- 'parent_group_id' => 1,
- 'child_group_id' => 3,
-);
-try{
- $result = civicrm_api3('group_nesting', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using group_nesting create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function group_nesting_create_example() {
+ $params = array(
+ 'parent_group_id' => 1,
+ 'child_group_id' => 3,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('group_nesting', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function group_nesting_create_expectedresult(){
+function group_nesting_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 'is_error',
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 'is_error',
+ 'values' => array(
'is_error' => 0,
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreate and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreate
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/GroupNestingTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using group_nesting delete API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function group_nesting_delete_example(){
-$params = array(
- 'id' => 1,
-);
-try{
- $result = civicrm_api3('group_nesting', 'delete', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using group_nesting delete API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function group_nesting_delete_example() {
+ $params = array(
+ 'id' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('group_nesting', 'delete', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function group_nesting_delete_expectedresult(){
+function group_nesting_delete_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'values' => 1,
-);
+ '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
-*
-* testDelete and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testDelete
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/GroupNestingTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using group_nesting get API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function group_nesting_get_example(){
-$params = array(
- 'parent_group_id' => 1,
- 'child_group_id' => 2,
-);
-try{
- $result = civicrm_api3('group_nesting', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using group_nesting get API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function group_nesting_get_example() {
+ $params = array(
+ 'parent_group_id' => 1,
+ 'child_group_id' => 2,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('group_nesting', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function group_nesting_get_expectedresult(){
+function group_nesting_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'child_group_id' => '2',
- 'parent_group_id' => '1',
- ),
+ 'id' => '1',
+ 'child_group_id' => '2',
+ 'parent_group_id' => '1',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGet and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGet
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/GroupNestingTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using group_organization create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function group_organization_create_example(){
-$params = array(
- 'organization_id' => 1,
- 'group_id' => 1,
-);
-try{
- $result = civicrm_api3('group_organization', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using group_organization create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function group_organization_create_example() {
+ $params = array(
+ 'organization_id' => 8,
+ 'group_id' => 6,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('group_organization', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function group_organization_create_expectedresult(){
+function group_organization_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 3,
- 'id' => 1,
- 'values' => array(
- 'id' => '1',
- 'group_id' => '1',
- 'organization_id' => '1',
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 3,
+ 'id' => 3,
+ 'values' => array(
+ 'id' => '3',
+ 'group_id' => '6',
+ 'organization_id' => '8',
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGroupOrganizationCreate and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGroupOrganizationCreate
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/GroupOrganizationTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using group_organization delete API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function group_organization_delete_example(){
-$params = array(
- 'id' => 1,
-);
-try{
- $result = civicrm_api3('group_organization', 'delete', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using group_organization delete API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function group_organization_delete_example() {
+ $params = array(
+ 'id' => 5,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('group_organization', 'delete', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function group_organization_delete_expectedresult(){
+function group_organization_delete_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'values' => 'Deleted Group Organization successfully',
-);
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'values' => 'Deleted Group Organization successfully',
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGroupOrganizationDelete and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGroupOrganizationDelete
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/GroupOrganizationTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using group_organization get API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function group_organization_get_example(){
-$params = array(
- 'organization_id' => 1,
-);
-try{
- $result = civicrm_api3('group_organization', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using group_organization get API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function group_organization_get_example() {
+ $params = array(
+ 'organization_id' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('group_organization', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function group_organization_get_expectedresult(){
+function group_organization_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 0,
- 'values' => array(),
-);
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 0,
+ 'values' => array(),
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGroupOrganizationGet and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGroupOrganizationGet
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/GroupOrganizationTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using im create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function im_create_example(){
-$params = array(
- 'contact_id' => 3,
- 'name' => 'My Yahoo IM Handle',
- 'location_type_id' => 1,
- 'provider_id' => 1,
-);
-try{
- $result = civicrm_api3('im', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using im create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function im_create_example() {
+ $params = array(
+ 'contact_id' => 3,
+ 'name' => 'My Yahoo IM Handle',
+ 'location_type_id' => 1,
+ 'provider_id' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('im', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function im_create_expectedresult(){
+function im_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'contact_id' => '3',
- 'location_type_id' => '1',
- 'name' => 'My Yahoo IM Handle',
- 'provider_id' => '1',
- 'is_primary' => '',
- 'is_billing' => '',
- ),
+ 'id' => '1',
+ 'contact_id' => '3',
+ 'location_type_id' => '1',
+ 'name' => 'My Yahoo IM Handle',
+ 'provider_id' => '1',
+ 'is_primary' => '',
+ 'is_billing' => '',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreateIm and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreateIm
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ImTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using im delete API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function im_delete_example(){
-$params = array(
- 'id' => 1,
-);
-try{
- $result = civicrm_api3('im', 'delete', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using im delete API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function im_delete_example() {
+ $params = array(
+ 'id' => 3,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('im', 'delete', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function im_delete_expectedresult(){
+function im_delete_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'values' => true,
-);
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'values' => TRUE,
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testDeleteIm and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testDeleteIm
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ImTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using im get API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function im_get_example(){
-$params = array(
- 'contact_id' => 1,
- 'name' => 'My Yahoo IM Handle',
- 'location_type_id' => 1,
- 'provider_id' => 1,
-);
-try{
- $result = civicrm_api3('im', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using im get API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function im_get_example() {
+ $params = array(
+ 'contact_id' => 4,
+ 'name' => 'My Yahoo IM Handle',
+ 'location_type_id' => 1,
+ 'provider_id' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('im', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function im_get_expectedresult(){
+function im_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
- '1' => array(
- 'id' => '1',
- 'contact_id' => '1',
- 'location_type_id' => '1',
- 'name' => 'My Yahoo IM Handle',
- 'provider_id' => '1',
- 'is_primary' => 0,
- 'is_billing' => 0,
- ),
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 2,
+ 'values' => array(
+ '2' => array(
+ 'id' => '2',
+ 'contact_id' => '4',
+ 'location_type_id' => '1',
+ 'name' => 'My Yahoo IM Handle',
+ 'provider_id' => '1',
+ 'is_primary' => 0,
+ 'is_billing' => 0,
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetIm and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetIm
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ImTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using job create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function job_create_example(){
-$params = array(
- 'sequential' => 1,
- 'name' => 'API_Test_Job',
- 'description' => 'A long description written by hand in cursive',
- 'run_frequency' => 'Daily',
- 'api_entity' => 'ApiTestEntity',
- 'api_action' => 'apitestaction',
- 'parameters' => 'Semi-formal explanation of runtime job parameters',
- 'is_active' => 1,
-);
-try{
- $result = civicrm_api3('job', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using job create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function job_create_example() {
+ $params = array(
+ 'sequential' => 1,
+ 'name' => 'API_Test_Job',
+ 'description' => 'A long description written by hand in cursive',
+ 'run_frequency' => 'Daily',
+ 'api_entity' => 'ApiTestEntity',
+ 'api_action' => 'apitestaction',
+ 'parameters' => 'Semi-formal explanation of runtime job parameters',
+ 'is_active' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('job', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function job_create_expectedresult(){
+function job_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 29,
+ 'values' => array(
'0' => array(
- 'id' => '1',
- 'domain_id' => '1',
- 'run_frequency' => 'Daily',
- 'last_run' => '',
- 'name' => 'API_Test_Job',
- 'description' => 'A long description written by hand in cursive',
- 'api_entity' => 'ApiTestEntity',
- 'api_action' => 'apitestaction',
- 'parameters' => 'Semi-formal explanation of runtime job parameters',
- 'is_active' => '1',
- ),
+ 'id' => '29',
+ 'domain_id' => '1',
+ 'run_frequency' => 'Daily',
+ 'last_run' => '',
+ 'name' => 'API_Test_Job',
+ 'description' => 'A long description written by hand in cursive',
+ 'api_entity' => 'ApiTestEntity',
+ 'api_action' => 'apitestaction',
+ 'parameters' => 'Semi-formal explanation of runtime job parameters',
+ 'is_active' => '1',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreate and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreate
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/JobTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using job delete API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function job_delete_example(){
-$params = array(
- 'id' => 1,
-);
-try{
- $result = civicrm_api3('job', 'delete', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using job delete API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function job_delete_example() {
+ $params = array(
+ 'id' => 30,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('job', 'delete', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function job_delete_expectedresult(){
+function job_delete_expectedresult() {
$expectedResult = '';
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testDelete and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testDelete
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/JobTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using line_item create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function line_item_create_example(){
-$params = array(
- 'price_field_value_id' => 1,
- 'price_field_id' => 1,
- 'entity_table' => 'civicrm_contribution',
- 'entity_id' => 1,
- 'qty' => 1,
- 'unit_price' => 50,
- 'line_total' => 50,
- 'debug' => 1,
-);
-try{
- $result = civicrm_api3('line_item', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using line_item create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function line_item_create_example() {
+ $params = array(
+ 'price_field_value_id' => 1,
+ 'price_field_id' => 1,
+ 'entity_table' => 'civicrm_contribution',
+ 'entity_id' => 1,
+ 'qty' => 1,
+ 'unit_price' => 50,
+ 'line_total' => 50,
+ 'debug' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('line_item', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function line_item_create_expectedresult(){
+function line_item_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
- '1' => array(
- 'id' => '1',
- 'entity_table' => 'civicrm_contribution',
- 'entity_id' => '1',
- 'contribution_id' => '',
- 'price_field_id' => '1',
- 'label' => 'line item',
- 'qty' => '1',
- 'unit_price' => '50',
- 'line_total' => '50',
- 'participant_count' => '',
- 'price_field_value_id' => '1',
- 'financial_type_id' => '',
- 'deductible_amount' => '',
- ),
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 2,
+ 'values' => array(
+ '2' => array(
+ 'id' => '2',
+ 'entity_table' => 'civicrm_contribution',
+ 'entity_id' => '1',
+ 'contribution_id' => '',
+ 'price_field_id' => '1',
+ 'label' => 'line item',
+ 'qty' => '1',
+ 'unit_price' => '50',
+ 'line_total' => '50',
+ 'participant_count' => '',
+ 'price_field_value_id' => '1',
+ 'financial_type_id' => '',
+ 'deductible_amount' => '',
+ 'tax_amount' => '',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreateLineItem and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreateLineItem
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/LineItemTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using line_item delete API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function line_item_delete_example(){
-$params = array(
- 'id' => 1,
-);
-try{
- $result = civicrm_api3('line_item', 'delete', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using line_item delete API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function line_item_delete_example() {
+ $params = array(
+ 'id' => 4,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('line_item', 'delete', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function line_item_delete_expectedresult(){
+function line_item_delete_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'values' => 1,
-);
+ '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
-*
-* testDeleteLineItem and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testDeleteLineItem
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/LineItemTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using line_item get API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function line_item_get_example(){
-$params = array(
- 'entity_table' => 'civicrm_contribution',
-);
-try{
- $result = civicrm_api3('line_item', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using line_item get API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function line_item_get_example() {
+ $params = array(
+ 'entity_table' => 'civicrm_contribution',
+ );
-return $result;
+ try{
+ $result = civicrm_api3('line_item', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function line_item_get_expectedresult(){
+function line_item_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
- '1' => array(
- 'id' => '1',
- 'entity_table' => 'civicrm_contribution',
- 'entity_id' => '1',
- 'contribution_id' => '1',
- 'price_field_id' => '1',
- 'label' => 'Contribution Amount',
- 'qty' => '1',
- 'unit_price' => '100.00',
- 'line_total' => '100.00',
- 'price_field_value_id' => '1',
- 'financial_type_id' => '1',
- 'deductible_amount' => '0.00',
- ),
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 3,
+ 'values' => array(
+ '3' => array(
+ 'id' => '3',
+ 'entity_table' => 'civicrm_contribution',
+ 'entity_id' => '2',
+ 'contribution_id' => '2',
+ 'price_field_id' => '1',
+ 'label' => 'Contribution Amount',
+ 'qty' => '1',
+ 'unit_price' => '100.00',
+ 'line_total' => '100.00',
+ 'price_field_value_id' => '1',
+ 'financial_type_id' => '1',
+ 'deductible_amount' => '0.00',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetBasicLineItem and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetBasicLineItem
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/LineItemTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using loc_block create API
- * Create entities and locBlock in 1 api call *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function loc_block_create_example(){
-$params = array(
- 'email' => array(
+
+/**
+ * Test Generated example of using loc_block create API.
+ *
+ * Create entities and locBlock in 1 api call
+ *
+ * @return array
+ * API result array
+ */
+function loc_block_create_example() {
+ $params = array(
+ 'email' => array(
'location_type_id' => 1,
'email' => 'test2@loc.block',
),
- 'phone' => array(
+ 'phone' => array(
'location_type_id' => 1,
'phone' => '987654321',
),
- 'phone_2' => array(
+ 'phone_2' => array(
'location_type_id' => 1,
'phone' => '456-7890',
),
- 'address' => array(
+ 'address' => array(
'location_type_id' => 1,
'street_address' => '987654321',
),
-);
+ );
-try{
- $result = civicrm_api3('loc_block', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+ try{
+ $result = civicrm_api3('loc_block', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
-return $result;
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function loc_block_create_expectedresult(){
+function loc_block_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 3,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 3,
+ 'values' => array(
'3' => array(
- 'address' => array(
- 'id' => '3',
- 'location_type_id' => '1',
- 'is_primary' => 0,
- 'is_billing' => 0,
- 'street_address' => '987654321',
- 'manual_geo_code' => 0,
- ),
- 'email' => array(
- 'id' => '33',
- 'contact_id' => '',
- 'location_type_id' => '1',
- 'email' => 'test2@loc.block',
- 'is_primary' => 0,
- 'is_billing' => '',
- 'on_hold' => '',
- 'is_bulkmail' => '',
- 'hold_date' => '',
- 'reset_date' => '',
- 'signature_text' => '',
- 'signature_html' => '',
- ),
- 'phone' => array(
- 'id' => '3',
- 'contact_id' => '',
- 'location_type_id' => '1',
- 'is_primary' => 0,
- 'is_billing' => '',
- 'mobile_provider_id' => '',
- 'phone' => '987654321',
- 'phone_ext' => '',
- 'phone_numeric' => '',
- 'phone_type_id' => '',
- ),
- 'phone_2' => array(
- 'id' => '4',
- 'contact_id' => '',
- 'location_type_id' => '1',
- 'is_primary' => 0,
- 'is_billing' => '',
- 'mobile_provider_id' => '',
- 'phone' => '456-7890',
- 'phone_ext' => '',
- 'phone_numeric' => '',
- 'phone_type_id' => '',
- ),
+ 'address' => array(
+ 'id' => '3',
+ 'location_type_id' => '1',
+ 'is_primary' => 0,
+ 'is_billing' => 0,
+ 'street_address' => '987654321',
+ 'manual_geo_code' => 0,
+ ),
+ 'email' => array(
+ 'id' => '4',
+ 'contact_id' => '',
+ 'location_type_id' => '1',
+ 'email' => 'test2@loc.block',
+ 'is_primary' => 0,
+ 'is_billing' => '',
+ 'on_hold' => '',
+ 'is_bulkmail' => '',
+ 'hold_date' => '',
+ 'reset_date' => '',
+ 'signature_text' => '',
+ 'signature_html' => '',
+ ),
+ 'phone' => array(
'id' => '3',
- 'address_id' => '3',
- 'email_id' => '33',
- 'phone_id' => '3',
- 'im_id' => '',
- 'address_2_id' => '',
- 'email_2_id' => '',
- 'phone_2_id' => '4',
- 'im_2_id' => '',
+ 'contact_id' => '',
+ 'location_type_id' => '1',
+ 'is_primary' => 0,
+ 'is_billing' => '',
+ 'mobile_provider_id' => '',
+ 'phone' => '987654321',
+ 'phone_ext' => '',
+ 'phone_numeric' => '',
+ 'phone_type_id' => '',
+ ),
+ 'phone_2' => array(
+ 'id' => '4',
+ 'contact_id' => '',
+ 'location_type_id' => '1',
+ 'is_primary' => 0,
+ 'is_billing' => '',
+ 'mobile_provider_id' => '',
+ 'phone' => '456-7890',
+ 'phone_ext' => '',
+ 'phone_numeric' => '',
+ 'phone_type_id' => '',
),
+ 'id' => '3',
+ 'address_id' => '3',
+ 'email_id' => '4',
+ 'phone_id' => '3',
+ 'im_id' => '',
+ 'address_2_id' => '',
+ 'email_2_id' => '',
+ 'phone_2_id' => '4',
+ 'im_2_id' => '',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreateLocBlockEntities and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreateLocBlockEntities
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/LocBlockTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using loc_block get API
- * Get entities and location block in 1 api call *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function loc_block_get_example(){
-$params = array(
- 'id' => 3,
- 'return' => 'all',
-);
-try{
- $result = civicrm_api3('loc_block', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using loc_block get API.
+ *
+ * Get entities and location block in 1 api call
+ *
+ * @return array
+ * API result array
+ */
+function loc_block_get_example() {
+ $params = array(
+ 'id' => 3,
+ 'return' => 'all',
+ );
+
+ try{
+ $result = civicrm_api3('loc_block', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
-return $result;
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function loc_block_get_expectedresult(){
+function loc_block_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 3,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 3,
+ 'values' => array(
'3' => array(
+ 'id' => '3',
+ 'address_id' => '3',
+ 'email_id' => '4',
+ 'phone_id' => '3',
+ 'phone_2_id' => '4',
+ 'address' => array(
+ 'id' => '3',
+ 'location_type_id' => '1',
+ 'is_primary' => 0,
+ 'is_billing' => 0,
+ 'street_address' => '987654321',
+ 'manual_geo_code' => 0,
+ ),
+ 'email' => array(
+ 'id' => '4',
+ 'location_type_id' => '1',
+ 'email' => 'test2@loc.block',
+ 'is_primary' => 0,
+ 'is_billing' => 0,
+ 'on_hold' => 0,
+ 'is_bulkmail' => 0,
+ ),
+ 'phone' => array(
'id' => '3',
- 'address_id' => '3',
- 'email_id' => '33',
- 'phone_id' => '3',
- 'phone_2_id' => '4',
- 'address' => array(
- 'id' => '3',
- 'location_type_id' => '1',
- 'is_primary' => 0,
- 'is_billing' => 0,
- 'street_address' => '987654321',
- 'manual_geo_code' => 0,
- ),
- 'email' => array(
- 'id' => '33',
- 'location_type_id' => '1',
- 'email' => 'test2@loc.block',
- 'is_primary' => 0,
- 'is_billing' => 0,
- 'on_hold' => 0,
- 'is_bulkmail' => 0,
- ),
- 'phone' => array(
- 'id' => '3',
- 'location_type_id' => '1',
- 'is_primary' => 0,
- 'is_billing' => 0,
- 'phone' => '987654321',
- 'phone_numeric' => '987654321',
- ),
- 'phone_2' => array(
- 'id' => '4',
- 'location_type_id' => '1',
- 'is_primary' => 0,
- 'is_billing' => 0,
- 'phone' => '456-7890',
- 'phone_numeric' => '4567890',
- ),
+ 'location_type_id' => '1',
+ 'is_primary' => 0,
+ 'is_billing' => 0,
+ 'phone' => '987654321',
+ 'phone_numeric' => '987654321',
+ ),
+ 'phone_2' => array(
+ 'id' => '4',
+ 'location_type_id' => '1',
+ 'is_primary' => 0,
+ 'is_billing' => 0,
+ 'phone' => '456-7890',
+ 'phone_numeric' => '4567890',
),
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreateLocBlockEntities and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreateLocBlockEntities
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/LocBlockTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using loc_block create API
- * Create locBlock with existing entities *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function loc_block_create_example(){
-$params = array(
- 'address_id' => 2,
- 'phone_id' => 2,
- 'email_id' => 32,
-);
-try{
- $result = civicrm_api3('loc_block', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using loc_block create API.
+ *
+ * Create locBlock with existing entities
+ *
+ * @return array
+ * API result array
+ */
+function loc_block_create_example() {
+ $params = array(
+ 'address_id' => 2,
+ 'phone_id' => 2,
+ 'email_id' => 3,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('loc_block', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function loc_block_create_expectedresult(){
+function loc_block_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 2,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 2,
+ 'values' => array(
'2' => array(
- 'id' => '2',
- 'address_id' => '2',
- 'email_id' => '32',
- 'phone_id' => '2',
- 'im_id' => '',
- 'address_2_id' => '',
- 'email_2_id' => '',
- 'phone_2_id' => '',
- 'im_2_id' => '',
- ),
+ 'id' => '2',
+ 'address_id' => '2',
+ 'email_id' => '3',
+ 'phone_id' => '2',
+ 'im_id' => '',
+ 'address_2_id' => '',
+ 'email_2_id' => '',
+ 'phone_2_id' => '',
+ 'im_2_id' => '',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreateLocBlock and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreateLocBlock
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/LocBlockTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using mail_settings get API
- * demonstrates get + delete in the same call *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function mail_settings_get_example(){
-$params = array(
- 'title' => 'MailSettings title',
- 'api.MailSettings.delete' => 1,
-);
-try{
- $result = civicrm_api3('mail_settings', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using mail_settings get API.
+ *
+ * demonstrates get + delete in the same call
+ *
+ * @return array
+ * API result array
+ */
+function mail_settings_get_example() {
+ $params = array(
+ 'title' => 'MailSettings title',
+ 'api.MailSettings.delete' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('mail_settings', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function mail_settings_get_expectedresult(){
+function mail_settings_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 2,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 2,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'domain_id' => '1',
- 'name' => 'default',
- 'is_default' => 0,
- 'domain' => 'EXAMPLE.ORG',
- 'api.MailSettings.delete' => array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'values' => 1,
- ),
+ 'id' => '1',
+ 'domain_id' => '1',
+ 'name' => 'default',
+ 'is_default' => 0,
+ 'domain' => 'EXAMPLE.ORG',
+ 'api.MailSettings.delete' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'values' => 1,
),
+ ),
'6' => array(
- 'id' => '6',
- 'domain_id' => '1',
- 'name' => 'my mail setting',
- 'is_default' => '1',
- 'domain' => 'setting.com',
- 'server' => 'localhost',
- 'username' => 'sue',
- 'password' => 'pass',
- 'is_ssl' => 0,
- 'api.MailSettings.delete' => array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'values' => 1,
- ),
+ 'id' => '6',
+ 'domain_id' => '1',
+ 'name' => 'my mail setting',
+ 'is_default' => '1',
+ 'domain' => 'setting.com',
+ 'server' => 'localhost',
+ 'username' => 'sue',
+ 'password' => 'pass',
+ 'is_ssl' => 0,
+ 'api.MailSettings.delete' => 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
-*
-* testGetMailSettingsChainDelete and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetMailSettingsChainDelete
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MailSettingsTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using mail_settings create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function mail_settings_create_example(){
-$params = array(
- 'domain_id' => 1,
- 'name' => 'my mail setting',
- 'domain' => 'setting.com',
- 'local_part' => 'civicrm+',
- 'server' => 'localhost',
- 'username' => 'sue',
- 'password' => 'pass',
- 'is_default' => 1,
-);
-try{
- $result = civicrm_api3('mail_settings', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using mail_settings create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function mail_settings_create_example() {
+ $params = array(
+ 'domain_id' => 1,
+ 'name' => 'my mail setting',
+ 'domain' => 'setting.com',
+ 'local_part' => 'civicrm+',
+ 'server' => 'localhost',
+ 'username' => 'sue',
+ 'password' => 'pass',
+ 'is_default' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('mail_settings', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function mail_settings_create_expectedresult(){
+function mail_settings_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 2,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 2,
+ 'values' => array(
'2' => array(
- 'id' => '2',
- 'domain_id' => '1',
- 'name' => 'my mail setting',
- 'is_default' => '1',
- 'domain' => 'setting.com',
- 'localpart' => '',
- 'return_path' => '',
- 'protocol' => '',
- 'server' => 'localhost',
- 'port' => '',
- 'username' => 'sue',
- 'password' => 'pass',
- 'is_ssl' => '',
- 'source' => '',
- ),
+ 'id' => '2',
+ 'domain_id' => '1',
+ 'name' => 'my mail setting',
+ 'is_default' => '1',
+ 'domain' => 'setting.com',
+ 'localpart' => '',
+ 'return_path' => '',
+ 'protocol' => '',
+ 'server' => 'localhost',
+ 'port' => '',
+ 'username' => 'sue',
+ 'password' => 'pass',
+ 'is_ssl' => '',
+ 'source' => '',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreateMailSettings and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreateMailSettings
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MailSettingsTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using mail_settings delete API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function mail_settings_delete_example(){
-$params = array(
- 'id' => 5,
-);
-try{
- $result = civicrm_api3('mail_settings', 'delete', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using mail_settings delete API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function mail_settings_delete_example() {
+ $params = array(
+ 'id' => 5,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('mail_settings', 'delete', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function mail_settings_delete_expectedresult(){
+function mail_settings_delete_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'values' => 1,
-);
+ '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
-*
-* testDeleteMailSettings and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testDeleteMailSettings
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MailSettingsTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using mail_settings get API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function mail_settings_get_example(){
-$params = array(
- 'domain_id' => 1,
- 'name' => 'my mail setting',
- 'domain' => 'setting.com',
- 'local_part' => 'civicrm+',
- 'server' => 'localhost',
- 'username' => 'sue',
- 'password' => 'pass',
- 'is_default' => 1,
-);
-try{
- $result = civicrm_api3('mail_settings', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using mail_settings get API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function mail_settings_get_example() {
+ $params = array(
+ 'domain_id' => 1,
+ 'name' => 'my mail setting',
+ 'domain' => 'setting.com',
+ 'local_part' => 'civicrm+',
+ 'server' => 'localhost',
+ 'username' => 'sue',
+ 'password' => 'pass',
+ 'is_default' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('mail_settings', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function mail_settings_get_expectedresult(){
+function mail_settings_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 4,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 4,
+ 'values' => array(
'4' => array(
- 'id' => '4',
- 'domain_id' => '1',
- 'name' => 'my mail setting',
- 'is_default' => '1',
- 'domain' => 'setting.com',
- 'server' => 'localhost',
- 'username' => 'sue',
- 'password' => 'pass',
- 'is_ssl' => 0,
- ),
+ 'id' => '4',
+ 'domain_id' => '1',
+ 'name' => 'my mail setting',
+ 'is_default' => '1',
+ 'domain' => 'setting.com',
+ 'server' => 'localhost',
+ 'username' => 'sue',
+ 'password' => 'pass',
+ 'is_ssl' => 0,
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetMailSettings and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetMailSettings
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MailSettingsTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using mailing create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function mailing_create_example(){
-$params = array(
- 'subject' => 'maild',
- 'body_text' => 'bdkfhdskfhduew',
- 'name' => 'mailing name',
- 'created_id' => 1,
-);
-try{
- $result = civicrm_api3('mailing', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using mailing create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function mailing_create_example() {
+ $params = array(
+ 'subject' => 'Hello {contact.display_name}',
+ 'body_text' => 'This is {contact.display_name}',
+ 'body_html' => '<p>This is {contact.display_name}</p>',
+ 'name' => 'mailing name',
+ 'created_id' => 3,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('mailing', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function mailing_create_expectedresult(){
+function mailing_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'domain_id' => '1',
- 'header_id' => '',
- 'footer_id' => '',
- 'reply_id' => '',
- 'unsubscribe_id' => '',
- 'resubscribe_id' => '',
- 'optout_id' => '',
- 'name' => 'mailing name',
- 'from_name' => 'FIXME',
- 'from_email' => 'info@EXAMPLE.ORG',
- 'replyto_email' => 'info@EXAMPLE.ORG',
- 'subject' => 'maild',
- 'body_text' => 'bdkfhdskfhduew',
- 'body_html' => '',
- 'url_tracking' => '1',
- 'forward_replies' => '',
- 'auto_responder' => 0,
- 'open_tracking' => '1',
- 'is_completed' => '',
- 'msg_template_id' => '',
- 'override_verp' => '1',
- 'created_id' => '1',
- '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' => '',
- 'sms_provider_id' => '',
- 'hash' => '',
- 'api.mailing_job.create' => array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
- '0' => array(
- 'id' => '1',
- 'mailing_id' => '1',
- 'scheduled_date' => '20130728085413',
- 'start_date' => '',
- 'end_date' => '',
- 'status' => 'Scheduled',
- 'is_test' => 0,
- 'job_type' => '',
- 'parent_id' => '',
- 'job_offset' => '',
- 'job_limit' => '',
- ),
- ),
+ 'id' => '1',
+ 'domain_id' => '1',
+ 'header_id' => '',
+ 'footer_id' => '',
+ 'reply_id' => '',
+ 'unsubscribe_id' => '',
+ 'resubscribe_id' => '',
+ 'optout_id' => '',
+ 'name' => 'mailing name',
+ 'from_name' => 'FIXME',
+ 'from_email' => 'info@EXAMPLE.ORG',
+ 'replyto_email' => 'info@EXAMPLE.ORG',
+ 'subject' => 'Hello {contact.display_name}',
+ 'body_text' => 'This is {contact.display_name}',
+ 'body_html' => '<p>This is {contact.display_name}</p>',
+ 'url_tracking' => '1',
+ 'forward_replies' => '',
+ 'auto_responder' => 0,
+ 'open_tracking' => '1',
+ 'is_completed' => '',
+ 'msg_template_id' => '',
+ 'override_verp' => '1',
+ 'created_id' => '3',
+ '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' => '',
+ 'sms_provider_id' => '',
+ 'hash' => '',
+ 'location_type_id' => '',
+ 'email_selection_method' => '',
+ 'api.mailing_job.create' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
+ '0' => array(
+ 'id' => '1',
+ 'mailing_id' => '1',
+ 'scheduled_date' => '20130728085413',
+ 'start_date' => '',
+ 'end_date' => '',
+ 'status' => 'Scheduled',
+ 'is_test' => 0,
+ 'job_type' => '',
+ 'parent_id' => '',
+ 'job_offset' => '',
+ 'job_limit' => '',
),
+ ),
),
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testMailerCreateSuccess and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testMailerCreateSuccess
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MailingTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using mailing delete API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function mailing_delete_example(){
-$params = array(
- 'id' => 2,
-);
-try{
- $result = civicrm_api3('mailing', 'delete', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using mailing delete API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function mailing_delete_example() {
+ $params = array(
+ 'id' => 12,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('mailing', 'delete', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function mailing_delete_expectedresult(){
+function mailing_delete_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'values' => true,
-);
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'values' => TRUE,
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testMailerDeleteSuccess and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testMailerDeleteSuccess
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MailingTest.php
*
* You can see the outcome of the API tests at
--- /dev/null
+<?php
+/**
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
+ */
+
+/**
+ * Test Generated example of using mailing submit API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function mailing_submit_example() {
+ $params = array(
+ 'scheduled_date' => '2014-12-13 10:00:00',
+ 'id' => 9,
+ );
+
+ try{
+ $result = civicrm_api3('mailing', 'submit', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $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_submit_expectedresult() {
+
+ $expectedResult = array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 9,
+ 'values' => array(
+ '9' => array(
+ 'id' => '9',
+ 'domain_id' => '1',
+ 'header_id' => '',
+ 'footer_id' => '',
+ 'reply_id' => '',
+ 'unsubscribe_id' => '',
+ 'resubscribe_id' => '',
+ 'optout_id' => '',
+ 'name' => 'mailing name',
+ 'from_name' => 'FIXME',
+ 'from_email' => 'info@EXAMPLE.ORG',
+ 'replyto_email' => 'info@EXAMPLE.ORG',
+ 'subject' => 'Hello {contact.display_name}',
+ 'body_text' => 'This is {contact.display_name}',
+ 'body_html' => '<p>This is {contact.display_name}</p>',
+ 'url_tracking' => '1',
+ 'forward_replies' => 0,
+ 'auto_responder' => 0,
+ 'open_tracking' => '1',
+ 'is_completed' => '',
+ 'msg_template_id' => '',
+ 'override_verp' => '1',
+ 'created_id' => '22',
+ 'created_date' => '2013-07-28 08:49:19',
+ 'scheduled_id' => '22',
+ 'scheduled_date' => '20130728085413',
+ 'approver_id' => '',
+ 'approval_date' => '',
+ 'approval_status_id' => '',
+ 'approval_note' => '',
+ 'is_archived' => 0,
+ 'visibility' => 'Public Pages',
+ 'campaign_id' => '',
+ 'dedupe_email' => 0,
+ 'sms_provider_id' => '',
+ 'hash' => '67eac7789eaee00',
+ 'location_type_id' => '',
+ 'email_selection_method' => '',
+ ),
+ ),
+ );
+
+ return $expectedResult;
+}
+
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testMailerSubmit
+* and can be found in
+* 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/explorer
+*
+* 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
+*/
<?php
/**
- * Test Generated example of using mailing_group subscribe API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function mailing_group_subscribe_example(){
-$params = array(
- 'email' => 'test@test.test',
- 'group_id' => 2,
- 'contact_id' => 3,
- 'hash' => 'b15de8b64e2cec34',
- 'time_stamp' => '20101212121212',
-);
-try{
- $result = civicrm_api3('mailing_group', 'subscribe', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using mailing_group subscribe API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function mailing_group_subscribe_example() {
+ $params = array(
+ 'email' => 'test@test.test',
+ 'group_id' => 2,
+ 'contact_id' => 3,
+ 'hash' => 'b15de8b64e2cec34',
+ 'time_stamp' => '20101212121212',
+ );
-return $result;
+ try{
+ $result = civicrm_api3('mailing_group', 'subscribe', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function mailing_group_subscribe_expectedresult(){
+function mailing_group_subscribe_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'contact_id' => '3',
- 'subscribe_id' => '1',
- 'hash' => '67eac7789eaee00',
- ),
+ '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 in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testMailerGroupSubscribeGivenContactId
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MailingGroupTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using membership create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function membership_create_example(){
-$params = array(
- 'contact_id' => 88,
- 'membership_type_id' => 53,
- 'join_date' => '2009-01-21',
- 'start_date' => '2009-01-21',
- 'end_date' => '2009-12-21',
- 'source' => 'Payment',
- 'is_override' => 1,
- 'status_id' => 33,
- 'custom_1' => 'custom string',
-);
-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('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using membership create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function membership_create_example() {
+ $params = array(
+ 'contact_id' => 88,
+ 'membership_type_id' => 53,
+ 'join_date' => '2009-01-21',
+ 'start_date' => '2009-01-21',
+ 'end_date' => '2009-12-21',
+ 'source' => 'Payment',
+ 'is_override' => 1,
+ 'status_id' => 33,
+ 'custom_1' => 'custom string',
+ );
-return $result;
+ 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(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function membership_create_expectedresult(){
+function membership_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'contact_id' => '88',
- 'membership_type_id' => '53',
- 'join_date' => '20090121000000',
- 'start_date' => '2013-07-29 00:00:00',
- 'end_date' => '2013-08-04 00:00:00',
- 'source' => 'Payment',
- 'status_id' => '33',
- 'is_override' => '1',
- 'owner_membership_id' => '',
- 'max_related' => '',
- 'is_test' => 0,
- 'is_pay_later' => '',
- 'contribution_recur_id' => '',
- 'campaign_id' => '',
- ),
+ 'id' => '1',
+ 'contact_id' => '88',
+ 'membership_type_id' => '53',
+ 'join_date' => '20090121000000',
+ 'start_date' => '2013-07-29 00:00:00',
+ 'end_date' => '2013-08-04 00:00:00',
+ 'source' => 'Payment',
+ 'status_id' => '33',
+ '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
-*
-* testCreateWithCustom and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreateWithCustom
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MembershipTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using membership delete API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function membership_delete_example(){
-$params = array(
- 'id' => 1,
-);
-try{
- $result = civicrm_api3('membership', 'delete', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using membership delete API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function membership_delete_example() {
+ $params = array(
+ 'id' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('membership', 'delete', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function membership_delete_expectedresult(){
+function membership_delete_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'values' => true,
-);
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'values' => TRUE,
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testMembershipDelete and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testMembershipDelete
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MembershipTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using membership get API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function membership_get_example(){
-$params = array(
- 'membership_type_id' => 21,
-);
-try{
- $result = civicrm_api3('membership', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using membership get API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function membership_get_example() {
+ $params = array(
+ 'membership_type_id' => 21,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('membership', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function membership_get_expectedresult(){
+function membership_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'contact_id' => '35',
- 'membership_type_id' => '21',
- 'join_date' => '2009-01-21',
- 'start_date' => '2013-07-29 00:00:00',
- 'end_date' => '2013-08-04 00:00:00',
- 'source' => 'Payment',
- 'status_id' => '18',
- 'is_override' => '1',
- 'is_test' => 0,
- 'is_pay_later' => 0,
- 'membership_name' => 'General',
- 'relationship_name' => 'Child of',
- 'custom_1' => 'custom string',
- 'custom_1_1' => 'custom string',
- ),
+ 'id' => '1',
+ 'contact_id' => '35',
+ 'membership_type_id' => '21',
+ 'join_date' => '2009-01-21',
+ 'start_date' => '2013-07-29 00:00:00',
+ 'end_date' => '2013-08-04 00:00:00',
+ 'source' => 'Payment',
+ 'status_id' => '18',
+ 'is_override' => '1',
+ 'is_test' => 0,
+ 'is_pay_later' => 0,
+ 'membership_name' => 'General',
+ 'relationship_name' => 'Child of',
+ 'custom_1' => 'custom string',
+ 'custom_1_1' => 'custom string',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetWithParamsMemberShipIdAndCustom and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetWithParamsMemberShipIdAndCustom
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MembershipTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using membership update API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function membership_update_example(){
-$params = array(
- 'contact_id' => 106,
- 'membership_type_id' => 65,
- 'join_date' => '2009-01-21',
- 'start_date' => '2009-01-21',
- 'end_date' => '2009-12-21',
- 'source' => 'Payment',
- 'is_override' => 1,
- 'status_id' => 39,
- 'custom_1' => 'custom string',
-);
-try{
- $result = civicrm_api3('membership', 'update', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using membership update API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function membership_update_example() {
+ $params = array(
+ 'contact_id' => 106,
+ 'membership_type_id' => 65,
+ 'join_date' => '2009-01-21',
+ 'start_date' => '2009-01-21',
+ 'end_date' => '2009-12-21',
+ 'source' => 'Payment',
+ 'is_override' => 1,
+ 'status_id' => 39,
+ 'custom_1' => 'custom string',
+ );
-return $result;
+ try{
+ $result = civicrm_api3('membership', 'update', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function membership_update_expectedresult(){
+function membership_update_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'contact_id' => '106',
- 'membership_type_id' => '65',
- 'join_date' => '20090121000000',
- 'start_date' => '2013-07-29 00:00:00',
- 'end_date' => '2013-08-04 00:00:00',
- 'source' => 'Payment',
- 'status_id' => '39',
- 'is_override' => '1',
- 'owner_membership_id' => '',
- 'max_related' => '',
- 'is_test' => 0,
- 'is_pay_later' => '',
- 'contribution_recur_id' => '',
- 'campaign_id' => '',
- ),
+ 'id' => '1',
+ 'contact_id' => '106',
+ 'membership_type_id' => '65',
+ 'join_date' => '20090121000000',
+ 'start_date' => '2013-07-29 00:00:00',
+ 'end_date' => '2013-08-04 00:00:00',
+ 'source' => 'Payment',
+ 'status_id' => '39',
+ '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
-*
-* testUpdateWithCustom and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testUpdateWithCustom
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MembershipTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using membership get API
- * Demonstrates use of 'filter' active_only' param *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function membership_get_example(){
-$params = array(
- 'contact_id' => 44,
- 'filters' => array(
+
+/**
+ * Test Generated example of using membership get API.
+ *
+ * Demonstrates use of 'filter' active_only' param
+ *
+ * @return array
+ * API result array
+ */
+function membership_get_example() {
+ $params = array(
+ 'contact_id' => 44,
+ 'filters' => array(
'is_current' => 1,
),
-);
+ );
-try{
- $result = civicrm_api3('membership', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+ try{
+ $result = civicrm_api3('membership', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
-return $result;
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function membership_get_expectedresult(){
+function membership_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'contact_id' => '44',
- 'membership_type_id' => '27',
- 'join_date' => '2009-01-21',
- 'start_date' => '2013-07-29 00:00:00',
- 'end_date' => '2013-08-04 00:00:00',
- 'source' => 'Payment',
- 'status_id' => '21',
- 'is_override' => '1',
- 'is_test' => 0,
- 'is_pay_later' => 0,
- 'membership_name' => 'General',
- 'relationship_name' => 'Child of',
- ),
+ 'id' => '1',
+ 'contact_id' => '44',
+ 'membership_type_id' => '27',
+ 'join_date' => '2009-01-21',
+ 'start_date' => '2013-07-29 00:00:00',
+ 'end_date' => '2013-08-04 00:00:00',
+ 'source' => 'Payment',
+ 'status_id' => '21',
+ 'is_override' => '1',
+ 'is_test' => 0,
+ 'is_pay_later' => 0,
+ 'membership_name' => 'General',
+ 'relationship_name' => 'Child of',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetOnlyActive and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetOnlyActive
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MembershipTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using membership_payment create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function membership_payment_create_example(){
-$params = array(
- 'contribution_id' => 1,
- 'membership_id' => 1,
-);
-try{
- $result = civicrm_api3('membership_payment', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using membership_payment create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function membership_payment_create_example() {
+ $params = array(
+ 'contribution_id' => 2,
+ 'membership_id' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('membership_payment', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function membership_payment_create_expectedresult(){
+function membership_payment_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'membership_id' => '1',
- 'contribution_id' => '1',
- ),
+ 'id' => '1',
+ 'membership_id' => '1',
+ 'contribution_id' => '2',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreate and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreate
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MembershipPaymentTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using membership_payment get API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function membership_payment_get_example(){
-$params = array(
- 'contribution_id' => 1,
- 'membership_id' => 1,
-);
-try{
- $result = civicrm_api3('membership_payment', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using membership_payment get API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function membership_payment_get_example() {
+ $params = array(
+ 'contribution_id' => 4,
+ 'membership_id' => 2,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('membership_payment', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function membership_payment_get_expectedresult(){
+function membership_payment_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
- '1' => array(
- 'id' => '1',
- 'membership_id' => '1',
- 'contribution_id' => '1',
- ),
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 2,
+ 'values' => array(
+ '2' => array(
+ 'id' => '2',
+ 'membership_id' => '2',
+ 'contribution_id' => '4',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGet and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGet
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MembershipPaymentTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using membership_status create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function membership_status_create_example(){
-$params = array(
- 'name' => 'test membership status',
-);
-try{
- $result = civicrm_api3('membership_status', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using membership_status create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function membership_status_create_example() {
+ $params = array(
+ 'name' => 'test membership status',
+ );
-return $result;
+ try{
+ $result = civicrm_api3('membership_status', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function membership_status_create_expectedresult(){
+function membership_status_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 15,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 15,
+ 'values' => array(
'15' => array(
- 'id' => '15',
- 'name' => 'test membership status',
- 'label' => 'test membership status',
- 'start_event' => '',
- 'start_event_adjust_unit' => '',
- 'start_event_adjust_interval' => '',
- 'end_event' => '',
- 'end_event_adjust_unit' => '',
- 'end_event_adjust_interval' => '',
- 'is_current_member' => '',
- 'is_admin' => '',
- 'weight' => '',
- 'is_default' => '',
- 'is_active' => '',
- 'is_reserved' => '',
- ),
+ 'id' => '15',
+ 'name' => 'test membership status',
+ 'label' => 'test membership status',
+ 'start_event' => '',
+ 'start_event_adjust_unit' => '',
+ 'start_event_adjust_interval' => '',
+ 'end_event' => '',
+ 'end_event_adjust_unit' => '',
+ 'end_event_adjust_interval' => '',
+ 'is_current_member' => '',
+ 'is_admin' => '',
+ 'weight' => '',
+ 'is_default' => '',
+ 'is_active' => '',
+ 'is_reserved' => '',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreate and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreate
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MembershipStatusTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using membership_status get API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function membership_status_get_example(){
-$params = array(
- 'name' => 'test status',
-);
-try{
- $result = civicrm_api3('membership_status', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using membership_status get API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function membership_status_get_example() {
+ $params = array(
+ 'name' => 'test status',
+ );
-return $result;
+ try{
+ $result = civicrm_api3('membership_status', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function membership_status_get_expectedresult(){
+function membership_status_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 9,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 9,
+ 'values' => array(
'9' => array(
- 'id' => '9',
- 'name' => 'test status',
- 'label' => 'test status',
- 'start_event' => 'start_date',
- 'end_event' => 'end_date',
- 'is_current_member' => '1',
- 'is_admin' => 0,
- 'is_default' => 0,
- 'is_active' => '1',
- 'is_reserved' => 0,
- ),
+ 'id' => '9',
+ 'name' => 'test status',
+ 'label' => 'test status',
+ 'start_event' => 'start_date',
+ 'end_event' => 'end_date',
+ 'is_current_member' => '1',
+ 'is_admin' => 0,
+ 'is_default' => 0,
+ 'is_active' => '1',
+ 'is_reserved' => 0,
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGet and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGet
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MembershipStatusTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using membership_type create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function membership_type_create_example(){
-$params = array(
- 'name' => '40+ Membership',
- 'description' => 'people above 40 are given health instructions',
- 'member_of_contact_id' => 1,
- 'financial_type_id' => 1,
- 'domain_id' => '1',
- 'minimum_fee' => '200',
- 'duration_unit' => 'month',
- 'duration_interval' => '10',
- 'period_type' => 'rolling',
- 'visibility' => 'public',
-);
-try{
- $result = civicrm_api3('membership_type', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using membership_type create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function membership_type_create_example() {
+ $params = array(
+ 'name' => '40+ Membership',
+ 'description' => 'people above 40 are given health instructions',
+ 'member_of_contact_id' => 13,
+ 'financial_type_id' => 1,
+ 'domain_id' => '1',
+ 'minimum_fee' => '200',
+ 'duration_unit' => 'month',
+ 'duration_interval' => '10',
+ 'period_type' => 'rolling',
+ 'visibility' => 'public',
+ );
-return $result;
+ try{
+ $result = civicrm_api3('membership_type', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function membership_type_create_expectedresult(){
+function membership_type_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 2,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 2,
+ 'values' => array(
'2' => array(
- 'id' => '2',
- 'domain_id' => '1',
- 'name' => '40+ Membership',
- 'description' => 'people above 40 are given health instructions',
- 'member_of_contact_id' => '1',
- 'financial_type_id' => '1',
- 'minimum_fee' => '200',
- 'duration_unit' => 'month',
- 'duration_interval' => '10',
- 'period_type' => 'rolling',
- 'fixed_period_start_day' => '',
- 'fixed_period_rollover_day' => '',
- 'relationship_type_id' => '',
- 'relationship_direction' => '',
- 'max_related' => '',
- 'visibility' => 'Public',
- 'weight' => '',
- 'receipt_text_signup' => '',
- 'receipt_text_renewal' => '',
- 'auto_renew' => '',
- 'is_active' => '',
- 'contribution_type_id' => '1',
- ),
+ 'id' => '2',
+ 'domain_id' => '1',
+ 'name' => '40+ Membership',
+ 'description' => 'people above 40 are given health instructions',
+ 'member_of_contact_id' => '13',
+ 'financial_type_id' => '1',
+ 'minimum_fee' => '200',
+ 'duration_unit' => 'month',
+ 'duration_interval' => '10',
+ 'period_type' => 'rolling',
+ 'fixed_period_start_day' => '',
+ 'fixed_period_rollover_day' => '',
+ 'relationship_type_id' => '',
+ 'relationship_direction' => '',
+ 'max_related' => '',
+ 'visibility' => 'Public',
+ 'weight' => '',
+ 'receipt_text_signup' => '',
+ 'receipt_text_renewal' => '',
+ 'auto_renew' => '',
+ 'is_active' => '',
+ 'contribution_type_id' => '1',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreate and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreate
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MembershipTypeTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using membership_type delete API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function membership_type_delete_example(){
-$params = array(
- 'id' => 4,
-);
-try{
- $result = civicrm_api3('membership_type', 'delete', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using membership_type delete API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function membership_type_delete_example() {
+ $params = array(
+ 'id' => 4,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('membership_type', 'delete', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function membership_type_delete_expectedresult(){
+function membership_type_delete_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'values' => true,
-);
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'values' => TRUE,
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testDelete and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testDelete
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MembershipTypeTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using membership_type get API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function membership_type_get_example(){
-$params = array(
- 'id' => 1,
-);
-try{
- $result = civicrm_api3('membership_type', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using membership_type get API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function membership_type_get_example() {
+ $params = array(
+ 'id' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('membership_type', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function membership_type_get_expectedresult(){
+function membership_type_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'domain_id' => '1',
- 'name' => 'General',
- 'member_of_contact_id' => '1',
- 'financial_type_id' => '1',
- 'minimum_fee' => '0.00',
- 'duration_unit' => 'year',
- 'duration_interval' => '1',
- 'period_type' => 'rolling',
- 'visibility' => 'Public',
- 'auto_renew' => 0,
- 'is_active' => '1',
- ),
+ 'id' => '1',
+ 'domain_id' => '1',
+ 'name' => 'General',
+ 'member_of_contact_id' => '4',
+ 'financial_type_id' => '1',
+ 'minimum_fee' => '0.00',
+ 'duration_unit' => 'year',
+ 'duration_interval' => '1',
+ 'period_type' => 'rolling',
+ 'visibility' => 'Public',
+ 'auto_renew' => 0,
+ 'is_active' => '1',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGet and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGet
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MembershipTypeTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using message_template create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function message_template_create_example(){
-$params = array(
- 'msg_title' => 'msg_title_131',
- 'msg_subject' => 'msg_subject_131',
- 'msg_text' => 'msg_text_131',
- 'msg_html' => 'msg_html_131',
- 'workflow_id' => 131,
- 'is_default' => '1',
- 'is_reserved' => 1,
-);
-try{
- $result = civicrm_api3('message_template', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using message_template create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function message_template_create_example() {
+ $params = array(
+ 'msg_title' => 'msg_title_165',
+ 'msg_subject' => 'msg_subject_165',
+ 'msg_text' => 'msg_text_165',
+ 'msg_html' => 'msg_html_165',
+ 'workflow_id' => 165,
+ 'is_default' => '1',
+ 'is_reserved' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('message_template', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function message_template_create_expectedresult(){
+function message_template_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 2,
- 'values' => array(
- '2' => array(
- 'id' => '2',
- 'msg_title' => 'msg_title_131',
- 'msg_subject' => 'msg_subject_131',
- 'msg_text' => 'msg_text_131',
- 'msg_html' => 'msg_html_131',
- 'is_active' => '1',
- 'workflow_id' => '131',
- 'is_default' => '1',
- 'is_reserved' => '1',
- 'pdf_format_id' => '',
- ),
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 65,
+ 'values' => array(
+ '65' => array(
+ 'id' => '65',
+ 'msg_title' => 'msg_title_165',
+ 'msg_subject' => 'msg_subject_165',
+ 'msg_text' => 'msg_text_165',
+ 'msg_html' => 'msg_html_165',
+ 'is_active' => '1',
+ 'workflow_id' => '165',
+ 'is_default' => '1',
+ 'is_reserved' => '1',
+ 'is_sms' => '',
+ 'pdf_format_id' => '',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreate and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreate
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MessageTemplateTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using message_template delete API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function message_template_delete_example(){
-$params = array(
- 'id' => 2,
-);
-try{
- $result = civicrm_api3('message_template', 'delete', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using message_template delete API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function message_template_delete_example() {
+ $params = array(
+ 'id' => 68,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('message_template', 'delete', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function message_template_delete_expectedresult(){
+function message_template_delete_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'values' => true,
-);
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'values' => TRUE,
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testDelete and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testDelete
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MessageTemplateTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using message_template get API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function message_template_get_example(){
-$params = array(
- 'msg_title' => 'msg_title_132',
- 'msg_subject' => 'msg_subject_132',
- 'msg_text' => 'msg_text_132',
- 'msg_html' => 'msg_html_132',
- 'workflow_id' => 132,
- 'is_default' => '1',
- 'is_reserved' => 1,
-);
-try{
- $result = civicrm_api3('message_template', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using message_template get API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function message_template_get_example() {
+ $params = array(
+ 'msg_title' => 'msg_title_166',
+ 'msg_subject' => 'msg_subject_166',
+ 'msg_text' => 'msg_text_166',
+ 'msg_html' => 'msg_html_166',
+ 'workflow_id' => 166,
+ 'is_default' => '1',
+ 'is_reserved' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('message_template', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function message_template_get_expectedresult(){
+function message_template_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
- '1' => array(
- 'id' => '1',
- 'msg_title' => 'msg_title_132',
- 'msg_subject' => 'msg_subject_132',
- 'msg_text' => 'msg_text_132',
- 'msg_html' => 'msg_html_132',
- 'is_active' => '1',
- 'workflow_id' => '132',
- 'is_default' => '1',
- 'is_reserved' => '1',
- 'pdf_format_id' => '132',
- ),
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 66,
+ 'values' => array(
+ '66' => array(
+ 'id' => '66',
+ 'msg_title' => 'msg_title_166',
+ 'msg_subject' => 'msg_subject_166',
+ 'msg_text' => 'msg_text_166',
+ 'msg_html' => 'msg_html_166',
+ 'is_active' => '1',
+ 'workflow_id' => '166',
+ 'is_default' => '1',
+ 'is_reserved' => '1',
+ 'is_sms' => '1',
+ 'pdf_format_id' => '166',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGet and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGet
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MessageTemplateTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using note create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function note_create_example(){
-$params = array(
- 'entity_table' => 'civicrm_contact',
- 'entity_id' => 1,
- 'note' => 'Hello!!! m testing Note',
- 'contact_id' => 1,
- 'modified_date' => '2011-01-31',
- 'subject' => 'Test Note',
-);
-try{
- $result = civicrm_api3('note', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using note create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function note_create_example() {
+ $params = array(
+ 'entity_table' => 'civicrm_contact',
+ 'entity_id' => 9,
+ 'note' => 'Hello!!! m testing Note',
+ 'contact_id' => 9,
+ 'modified_date' => '2011-01-31',
+ 'subject' => 'Test Note',
+ );
-return $result;
+ try{
+ $result = civicrm_api3('note', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function note_create_expectedresult(){
+function note_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 2,
- 'values' => array(
- '2' => array(
- 'id' => '2',
- 'entity_table' => 'civicrm_contact',
- 'entity_id' => '1',
- 'note' => 'Hello!!! m testing Note',
- 'contact_id' => '1',
- 'modified_date' => '2012-11-14 16:02:35',
- 'subject' => 'Test Note',
- 'privacy' => 0,
- ),
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 8,
+ 'values' => array(
+ '8' => array(
+ 'id' => '8',
+ 'entity_table' => 'civicrm_contact',
+ 'entity_id' => '9',
+ 'note' => 'Hello!!! m testing Note',
+ 'contact_id' => '9',
+ 'modified_date' => '2012-11-14 16:02:35',
+ 'subject' => 'Test Note',
+ 'privacy' => 0,
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreate and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreate
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/NoteTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using note delete API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function note_delete_example(){
-$params = array(
- 'id' => 2,
-);
-try{
- $result = civicrm_api3('note', 'delete', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using note delete API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function note_delete_example() {
+ $params = array(
+ 'id' => 19,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('note', 'delete', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function note_delete_expectedresult(){
+function note_delete_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'values' => 1,
-);
+ '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
-*
-* testDelete and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testDelete
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/NoteTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using note get API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function note_get_example(){
-$params = array(
- 'entity_table' => 'civicrm_contact',
- 'entity_id' => 1,
-);
-try{
- $result = civicrm_api3('note', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using note get API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function note_get_example() {
+ $params = array(
+ 'entity_table' => 'civicrm_contact',
+ 'entity_id' => 3,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('note', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function note_get_expectedresult(){
+function note_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
- '1' => array(
- 'id' => '1',
- 'entity_table' => 'civicrm_contact',
- 'entity_id' => '1',
- 'note' => 'hello I am testing Note',
- 'contact_id' => '1',
- 'modified_date' => '2012-11-14 16:02:35',
- 'subject' => 'Test Note',
- 'privacy' => 0,
- ),
- ),
-);
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 0,
+ 'values' => array(),
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGet and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGet
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/NoteTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using option_group create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function option_group_create_example(){
-$params = array(
- 'sequential' => 1,
- 'name' => 'civicrm_event.amount.560',
- 'is_reserved' => 1,
- 'is_active' => 1,
- 'api.OptionValue.create' => array(
+
+/**
+ * Test Generated example of using option_group create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function option_group_create_example() {
+ $params = array(
+ 'sequential' => 1,
+ 'name' => 'civicrm_event.amount.560',
+ 'is_reserved' => 1,
+ 'is_active' => 1,
+ 'api.OptionValue.create' => array(
'label' => 'workshop',
'value' => 35,
'is_default' => 1,
'is_active' => 1,
'format.only_id' => 1,
),
-);
+ );
-try{
- $result = civicrm_api3('option_group', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+ try{
+ $result = civicrm_api3('option_group', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
-return $result;
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function option_group_create_expectedresult(){
+function option_group_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 89,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 92,
+ 'values' => array(
'0' => array(
- 'id' => '89',
- 'name' => 'civicrm_event.amount.560',
- 'title' => '',
- 'description' => '',
- 'is_reserved' => '1',
- 'is_active' => '1',
- 'is_locked' => '',
- 'api.OptionValue.create' => 764,
- ),
+ 'id' => '92',
+ 'name' => 'civicrm_event.amount.560',
+ 'title' => '',
+ 'description' => '',
+ 'is_reserved' => '1',
+ 'is_active' => '1',
+ 'is_locked' => '',
+ 'api.OptionValue.create' => 780,
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetOptionCreateSuccess and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetOptionCreateSuccess
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/OptionGroupTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using option_group delete API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function option_group_delete_example(){
-$params = array(
- 'id' => 94,
-);
-try{
- $result = civicrm_api3('option_group', 'delete', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using option_group delete API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function option_group_delete_example() {
+ $params = array(
+ 'id' => 97,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('option_group', 'delete', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function option_group_delete_expectedresult(){
+function option_group_delete_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'values' => true,
-);
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'values' => TRUE,
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testDeleteOptionGroup and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testDeleteOptionGroup
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/OptionGroupTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using option_group get API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function option_group_get_example(){
-$params = array(
- 'name' => 'preferred_communication_method',
-);
-try{
- $result = civicrm_api3('option_group', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using option_group get API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function option_group_get_example() {
+ $params = array(
+ 'name' => 'preferred_communication_method',
+ );
-return $result;
+ try{
+ $result = civicrm_api3('option_group', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function option_group_get_expectedresult(){
+function option_group_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'name' => 'preferred_communication_method',
- 'title' => 'Preferred Communication Method',
- 'is_reserved' => '1',
- 'is_active' => '1',
- 'is_locked' => 0,
- ),
+ 'id' => '1',
+ 'name' => 'preferred_communication_method',
+ 'title' => 'Preferred Communication Method',
+ 'is_reserved' => '1',
+ 'is_active' => '1',
+ 'is_locked' => 0,
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetOptionGroupByName and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetOptionGroupByName
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/OptionGroupTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using option_value get API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function option_value_get_example(){
-$params = array(
- 'option_group_id' => 1,
-);
-try{
- $result = civicrm_api3('option_value', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using option_value get API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function option_value_get_example() {
+ $params = array(
+ 'option_group_id' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('option_value', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function option_value_get_expectedresult(){
+function option_value_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 5,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 5,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'option_group_id' => '1',
- 'label' => 'Phone',
- 'value' => '1',
- 'filter' => 0,
- 'weight' => '1',
- 'is_optgroup' => 0,
- 'is_reserved' => 0,
- 'is_active' => '1',
- ),
+ 'id' => '1',
+ 'option_group_id' => '1',
+ 'label' => 'Phone',
+ 'value' => '1',
+ 'filter' => 0,
+ 'weight' => '1',
+ 'is_optgroup' => 0,
+ 'is_reserved' => 0,
+ 'is_active' => '1',
+ ),
'2' => array(
- 'id' => '2',
- 'option_group_id' => '1',
- 'label' => 'Email',
- 'value' => '2',
- 'filter' => 0,
- 'weight' => '2',
- 'is_optgroup' => 0,
- 'is_reserved' => 0,
- 'is_active' => '1',
- ),
+ 'id' => '2',
+ 'option_group_id' => '1',
+ 'label' => 'Email',
+ 'value' => '2',
+ 'filter' => 0,
+ 'weight' => '2',
+ 'is_optgroup' => 0,
+ 'is_reserved' => 0,
+ 'is_active' => '1',
+ ),
'3' => array(
- 'id' => '3',
- 'option_group_id' => '1',
- 'label' => 'Postal Mail',
- 'value' => '3',
- 'filter' => 0,
- 'weight' => '3',
- 'is_optgroup' => 0,
- 'is_reserved' => 0,
- 'is_active' => '1',
- ),
+ 'id' => '3',
+ 'option_group_id' => '1',
+ 'label' => 'Postal Mail',
+ 'value' => '3',
+ 'filter' => 0,
+ 'weight' => '3',
+ 'is_optgroup' => 0,
+ 'is_reserved' => 0,
+ 'is_active' => '1',
+ ),
'4' => array(
- 'id' => '4',
- 'option_group_id' => '1',
- 'label' => 'SMS',
- 'value' => '4',
- 'filter' => 0,
- 'weight' => '4',
- 'is_optgroup' => 0,
- 'is_reserved' => 0,
- 'is_active' => '1',
- ),
+ 'id' => '4',
+ 'option_group_id' => '1',
+ 'label' => 'SMS',
+ 'value' => '4',
+ 'filter' => 0,
+ 'weight' => '4',
+ 'is_optgroup' => 0,
+ 'is_reserved' => 0,
+ 'is_active' => '1',
+ ),
'5' => array(
- 'id' => '5',
- 'option_group_id' => '1',
- 'label' => 'Fax',
- 'value' => '5',
- 'filter' => 0,
- 'weight' => '5',
- 'is_optgroup' => 0,
- 'is_reserved' => 0,
- 'is_active' => '1',
- ),
+ 'id' => '5',
+ 'option_group_id' => '1',
+ 'label' => 'Fax',
+ 'value' => '5',
+ 'filter' => 0,
+ 'weight' => '5',
+ 'is_optgroup' => 0,
+ 'is_reserved' => 0,
+ 'is_active' => '1',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetOptionGroup and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetOptionGroup
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/OptionValueTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using option_value getsingle API
- * demonstrates use of Sort param (available in many api functions). Also, getsingle *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function option_value_getsingle_example(){
-$params = array(
- 'option_group_id' => 1,
- 'options' => array(
+
+/**
+ * Test Generated example of using option_value getsingle API.
+ *
+ * demonstrates use of Sort param (available in many api functions). Also, getsingle
+ *
+ * @return array
+ * API result array
+ */
+function option_value_getsingle_example() {
+ $params = array(
+ 'option_group_id' => 1,
+ 'options' => array(
'sort' => 'label DESC',
'limit' => 1,
),
-);
+ );
-try{
- $result = civicrm_api3('option_value', 'getsingle', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+ try{
+ $result = civicrm_api3('option_value', 'getsingle', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
-return $result;
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function option_value_getsingle_expectedresult(){
+function option_value_getsingle_expectedresult() {
$expectedResult = array(
- 'id' => '4',
- 'option_group_id' => '1',
- 'label' => 'SMS',
- 'value' => '4',
- 'filter' => 0,
- 'weight' => '4',
- 'is_optgroup' => 0,
- 'is_reserved' => 0,
- 'is_active' => '1',
-);
+ 'id' => '4',
+ 'option_group_id' => '1',
+ 'label' => 'SMS',
+ 'value' => '4',
+ 'filter' => 0,
+ 'weight' => '4',
+ 'is_optgroup' => 0,
+ 'is_reserved' => 0,
+ 'is_active' => '1',
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetSingleValueOptionValueSort and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetSingleValueOptionValueSort
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/OptionValueTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using participant create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function participant_create_example(){
-$params = array(
- 'contact_id' => 4,
- 'event_id' => 1,
- 'status_id' => 1,
- 'role_id' => 1,
- 'register_date' => '2007-07-21 00:00:00',
- 'source' => 'Online Event Registration: API Testing',
- 'custom_1' => 'custom string',
-);
-try{
- $result = civicrm_api3('participant', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using participant create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function participant_create_example() {
+ $params = array(
+ 'contact_id' => 4,
+ 'event_id' => 1,
+ 'status_id' => 1,
+ 'role_id' => 1,
+ 'register_date' => '2007-07-21 00:00:00',
+ 'source' => 'Online Event Registration: API Testing',
+ 'custom_1' => 'custom string',
+ );
-return $result;
+ try{
+ $result = civicrm_api3('participant', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function participant_create_expectedresult(){
+function participant_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 4,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 4,
+ 'values' => array(
'4' => array(
- 'id' => '4',
- 'contact_id' => '4',
- 'event_id' => '1',
- 'status_id' => '1',
- 'role_id' => '1',
- 'register_date' => '20070721000000',
- 'source' => 'Online Event Registration: API Testing',
- 'fee_level' => '',
- 'is_test' => '',
- 'is_pay_later' => '',
- 'fee_amount' => '',
- 'registered_by_id' => '',
- 'discount_id' => '',
- 'fee_currency' => '',
- 'campaign_id' => '',
- 'discount_amount' => '',
- 'cart_id' => '',
- 'must_wait' => '',
- ),
+ 'id' => '4',
+ 'contact_id' => '4',
+ 'event_id' => '1',
+ 'status_id' => '1',
+ 'role_id' => '1',
+ 'register_date' => '20070721000000',
+ 'source' => 'Online Event Registration: API Testing',
+ 'fee_level' => '',
+ 'is_test' => '',
+ 'is_pay_later' => '',
+ 'fee_amount' => '',
+ 'registered_by_id' => '',
+ 'discount_id' => '',
+ 'fee_currency' => '',
+ 'campaign_id' => '',
+ 'discount_amount' => '',
+ 'cart_id' => '',
+ 'must_wait' => '',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreateWithCustom and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreateWithCustom
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ParticipantTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using participant create API
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
+ */
+
+/**
+ * Test Generated example of using participant create API.
+ *
* single function to create contact w partipation & contribution. Note that in the
- case of 'contribution' the 'create' is implied (api.contribution.create) *
+ case of 'contribution' the 'create' is implied (api.contribution.create)
+ *
+ * @return array
+ * API result array
*/
-function participant_create_example(){
-$params = array(
- 'contact_type' => 'Individual',
- 'display_name' => 'dlobo',
- 'api.participant' => array(
+function participant_create_example() {
+ $params = array(
+ 'contact_type' => 'Individual',
+ 'display_name' => 'dlobo',
+ 'api.participant' => array(
'event_id' => 40,
'status_id' => 1,
'role_id' => 1,
'format.only_id' => 1,
),
- 'api.contribution.create' => array(
+ 'api.contribution.create' => array(
'financial_type_id' => 1,
'total_amount' => 100,
'format.only_id' => 1,
),
- 'api.participant_payment.create' => array(
+ 'api.participant_payment.create' => array(
'contribution_id' => '$value.api.contribution.create',
'participant_id' => '$value.api.participant',
),
-);
+ );
-try{
- $result = civicrm_api3('participant', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+ try{
+ $result = civicrm_api3('participant', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
-return $result;
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function participant_create_expectedresult(){
+function participant_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 5,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 5,
+ 'values' => array(
'5' => array(
- 'id' => '5',
- 'contact_type' => 'Individual',
- 'contact_sub_type' => '',
- 'do_not_email' => 0,
- 'do_not_phone' => 0,
- 'do_not_mail' => 0,
- 'do_not_sms' => 0,
- 'do_not_trade' => 0,
- 'is_opt_out' => 0,
- 'legal_identifier' => '',
- 'external_identifier' => '',
- 'sort_name' => '',
- 'display_name' => 'dlobo',
- 'nick_name' => '',
- 'legal_name' => '',
- 'image_URL' => '',
- 'preferred_communication_method' => '',
- 'preferred_language' => 'en_US',
- 'preferred_mail_format' => 'Both',
- 'hash' => '67eac7789eaee00',
- 'api_key' => '',
- 'first_name' => '',
- 'middle_name' => '',
- 'last_name' => '',
- 'prefix_id' => '',
- 'suffix_id' => '',
- 'formal_title' => '',
- 'communication_style_id' => '',
- 'email_greeting_id' => '1',
- 'email_greeting_custom' => '',
- 'email_greeting_display' => '',
- 'postal_greeting_id' => '1',
- 'postal_greeting_custom' => '',
- 'postal_greeting_display' => '',
- 'addressee_id' => '1',
- 'addressee_custom' => '',
- 'addressee_display' => '',
- 'job_title' => '',
- 'gender_id' => '',
- 'birth_date' => '',
- 'is_deceased' => 0,
- 'deceased_date' => '',
- 'household_name' => '',
- 'primary_contact_id' => '',
- 'organization_name' => '',
- 'sic_code' => '',
- 'user_unique_id' => '',
- 'created_date' => '2013-07-28 08:49:19',
- 'modified_date' => '2012-11-14 16:02:35',
- 'api.participant' => 4,
- 'api.contribution.create' => 1,
- 'api.participant_payment.create' => array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
- '0' => array(
- 'id' => '1',
- 'participant_id' => '4',
- 'contribution_id' => '1',
- ),
- ),
+ 'id' => '5',
+ 'contact_type' => 'Individual',
+ 'contact_sub_type' => '',
+ 'do_not_email' => 0,
+ 'do_not_phone' => 0,
+ 'do_not_mail' => 0,
+ 'do_not_sms' => 0,
+ 'do_not_trade' => 0,
+ 'is_opt_out' => 0,
+ 'legal_identifier' => '',
+ 'external_identifier' => '',
+ 'sort_name' => '',
+ 'display_name' => 'dlobo',
+ 'nick_name' => '',
+ 'legal_name' => '',
+ 'image_URL' => '',
+ 'preferred_communication_method' => '',
+ 'preferred_language' => 'en_US',
+ 'preferred_mail_format' => 'Both',
+ 'hash' => '67eac7789eaee00',
+ 'api_key' => '',
+ 'first_name' => '',
+ 'middle_name' => '',
+ 'last_name' => '',
+ 'prefix_id' => '',
+ 'suffix_id' => '',
+ 'formal_title' => '',
+ 'communication_style_id' => '',
+ 'email_greeting_id' => '1',
+ 'email_greeting_custom' => '',
+ 'email_greeting_display' => '',
+ 'postal_greeting_id' => '1',
+ 'postal_greeting_custom' => '',
+ 'postal_greeting_display' => '',
+ 'addressee_id' => '1',
+ 'addressee_custom' => '',
+ 'addressee_display' => '',
+ 'job_title' => '',
+ 'gender_id' => '',
+ 'birth_date' => '',
+ 'is_deceased' => 0,
+ 'deceased_date' => '',
+ 'household_name' => '',
+ 'primary_contact_id' => '',
+ 'organization_name' => '',
+ 'sic_code' => '',
+ 'user_unique_id' => '',
+ 'created_date' => '2013-07-28 08:49:19',
+ 'modified_date' => '2012-11-14 16:02:35',
+ 'api.participant' => 4,
+ 'api.contribution.create' => 1,
+ 'api.participant_payment.create' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
+ '0' => array(
+ 'id' => '1',
+ 'participant_id' => '4',
+ 'contribution_id' => '1',
),
+ ),
),
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreateParticipantWithPayment and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreateParticipantWithPayment
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ParticipantTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using participant get API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function participant_get_example(){
-$params = array(
- 'id' => 1,
-);
-try{
- $result = civicrm_api3('participant', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using participant get API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function participant_get_example() {
+ $params = array(
+ 'id' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('participant', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function participant_get_expectedresult(){
+function participant_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'contact_id' => '2',
- 'contact_type' => 'Individual',
- 'contact_sub_type' => '',
- 'sort_name' => 'Anderson, Anthony',
- 'display_name' => 'Mr. Anthony Anderson II',
- 'event_id' => '5',
- 'event_title' => 'Annual CiviCRM meet',
- 'event_start_date' => '2013-07-29 00:00:00',
- 'event_end_date' => '2013-08-04 00:00:00',
- 'participant_id' => '1',
- 'participant_fee_level' => '',
- 'participant_fee_amount' => '',
- 'participant_fee_currency' => '',
- 'event_type' => 'Conference',
- 'participant_status_id' => '2',
- 'participant_status' => 'Attended',
- 'participant_role' => 'Attendee',
- 'participant_role_id' => '1',
- 'participant_register_date' => '2007-02-19 00:00:00',
- 'participant_source' => 'Wimbeldon',
- 'participant_note' => '',
- 'participant_is_pay_later' => 0,
- 'participant_is_test' => 0,
- 'participant_registered_by_id' => '',
- 'participant_discount_name' => '',
- 'participant_campaign_id' => '',
- 'id' => '1',
- ),
+ 'contact_id' => '2',
+ 'contact_type' => 'Individual',
+ 'contact_sub_type' => '',
+ 'sort_name' => 'Anderson, Anthony',
+ 'display_name' => 'Mr. Anthony Anderson II',
+ 'event_id' => '5',
+ 'event_title' => 'Annual CiviCRM meet',
+ 'event_start_date' => '2013-07-29 00:00:00',
+ 'event_end_date' => '2013-08-04 00:00:00',
+ 'participant_id' => '1',
+ 'participant_fee_level' => '',
+ 'participant_fee_amount' => '',
+ 'participant_fee_currency' => '',
+ 'event_type' => 'Conference',
+ 'participant_status_id' => '2',
+ 'participant_status' => 'Attended',
+ 'participant_role' => 'Attendee',
+ 'participant_role_id' => '1',
+ 'participant_register_date' => '2007-02-19 00:00:00',
+ 'participant_source' => 'Wimbeldon',
+ 'participant_note' => '',
+ 'participant_is_pay_later' => 0,
+ 'participant_is_test' => 0,
+ 'participant_registered_by_id' => '',
+ 'participant_discount_name' => '',
+ 'participant_campaign_id' => '',
+ 'id' => '1',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetParamsAsIdOnly and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetParamsAsIdOnly
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ParticipantTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using participant Get API
- * Criteria delete by nesting a GET & a DELETE *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function participant_get_example(){
-$params = array(
- 'contact_id' => 4,
- 'api.participant.delete' => 1,
-);
-try{
- $result = civicrm_api3('participant', 'Get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using participant Get API.
+ *
+ * Criteria delete by nesting a GET & a DELETE
+ *
+ * @return array
+ * API result array
+ */
+function participant_get_example() {
+ $params = array(
+ 'contact_id' => 4,
+ 'api.participant.delete' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('participant', 'Get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function participant_get_expectedresult(){
+function participant_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 2,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 2,
+ 'values' => array(
'2' => array(
- 'contact_id' => '4',
- 'contact_type' => 'Individual',
- 'contact_sub_type' => '',
- 'sort_name' => 'Anderson, Anthony',
- 'display_name' => 'Mr. Anthony Anderson II',
- 'event_id' => '39',
- 'event_title' => 'Annual CiviCRM meet',
- 'event_start_date' => '2013-07-29 00:00:00',
- 'event_end_date' => '2013-08-04 00:00:00',
- 'participant_id' => '2',
- 'participant_fee_level' => '',
- 'participant_fee_amount' => '',
- 'participant_fee_currency' => '',
- 'event_type' => 'Conference',
- 'participant_status_id' => '2',
- 'participant_status' => 'Attended',
- 'participant_role' => 'Attendee',
- 'participant_role_id' => '1',
- 'participant_register_date' => '2007-02-19 00:00:00',
- 'participant_source' => 'Wimbeldon',
- 'participant_note' => '',
- 'participant_is_pay_later' => 0,
- 'participant_is_test' => 0,
- 'participant_registered_by_id' => '',
- 'participant_discount_name' => '',
- 'participant_campaign_id' => '',
- 'id' => '2',
- 'api.participant.delete' => array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'values' => 1,
- ),
+ 'contact_id' => '4',
+ 'contact_type' => 'Individual',
+ 'contact_sub_type' => '',
+ 'sort_name' => 'Anderson, Anthony',
+ 'display_name' => 'Mr. Anthony Anderson II',
+ 'event_id' => '39',
+ 'event_title' => 'Annual CiviCRM meet',
+ 'event_start_date' => '2013-07-29 00:00:00',
+ 'event_end_date' => '2013-08-04 00:00:00',
+ 'participant_id' => '2',
+ 'participant_fee_level' => '',
+ 'participant_fee_amount' => '',
+ 'participant_fee_currency' => '',
+ 'event_type' => 'Conference',
+ 'participant_status_id' => '2',
+ 'participant_status' => 'Attended',
+ 'participant_role' => 'Attendee',
+ 'participant_role_id' => '1',
+ 'participant_register_date' => '2007-02-19 00:00:00',
+ 'participant_source' => 'Wimbeldon',
+ 'participant_note' => '',
+ 'participant_is_pay_later' => 0,
+ 'participant_is_test' => 0,
+ 'participant_registered_by_id' => '',
+ 'participant_discount_name' => '',
+ 'participant_campaign_id' => '',
+ 'id' => '2',
+ 'api.participant.delete' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'values' => 1,
),
+ ),
'3' => array(
- 'contact_id' => '4',
- 'contact_type' => 'Individual',
- 'contact_sub_type' => '',
- 'sort_name' => 'Anderson, Anthony',
- 'display_name' => 'Mr. Anthony Anderson II',
- 'event_id' => '39',
- 'event_title' => 'Annual CiviCRM meet',
- 'event_start_date' => '2013-07-29 00:00:00',
- 'event_end_date' => '2013-08-04 00:00:00',
- 'participant_id' => '3',
- 'participant_fee_level' => '',
- 'participant_fee_amount' => '',
- 'participant_fee_currency' => '',
- 'event_type' => 'Conference',
- 'participant_status_id' => '2',
- 'participant_status' => 'Attended',
- 'participant_role' => 'Attendee',
- 'participant_role_id' => '1',
- 'participant_register_date' => '2007-02-19 00:00:00',
- 'participant_source' => 'Wimbeldon',
- 'participant_note' => '',
- 'participant_is_pay_later' => 0,
- 'participant_is_test' => 0,
- 'participant_registered_by_id' => '',
- 'participant_discount_name' => '',
- 'participant_campaign_id' => '',
- 'id' => '3',
- 'api.participant.delete' => array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'values' => 1,
- ),
+ 'contact_id' => '4',
+ 'contact_type' => 'Individual',
+ 'contact_sub_type' => '',
+ 'sort_name' => 'Anderson, Anthony',
+ 'display_name' => 'Mr. Anthony Anderson II',
+ 'event_id' => '39',
+ 'event_title' => 'Annual CiviCRM meet',
+ 'event_start_date' => '2013-07-29 00:00:00',
+ 'event_end_date' => '2013-08-04 00:00:00',
+ 'participant_id' => '3',
+ 'participant_fee_level' => '',
+ 'participant_fee_amount' => '',
+ 'participant_fee_currency' => '',
+ 'event_type' => 'Conference',
+ 'participant_status_id' => '2',
+ 'participant_status' => 'Attended',
+ 'participant_role' => 'Attendee',
+ 'participant_role_id' => '1',
+ 'participant_register_date' => '2007-02-19 00:00:00',
+ 'participant_source' => 'Wimbeldon',
+ 'participant_note' => '',
+ 'participant_is_pay_later' => 0,
+ 'participant_is_test' => 0,
+ 'participant_registered_by_id' => '',
+ 'participant_discount_name' => '',
+ 'participant_campaign_id' => '',
+ 'id' => '3',
+ 'api.participant.delete' => 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
-*
-* testNestedDelete and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testNestedDelete
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ParticipantTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using participant get API
- * use nested get to get an event *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function participant_get_example(){
-$params = array(
- 'id' => 1,
- 'api.event.get' => 1,
-);
-try{
- $result = civicrm_api3('participant', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using participant get API.
+ *
+ * use nested get to get an event
+ *
+ * @return array
+ * API result array
+ */
+function participant_get_example() {
+ $params = array(
+ 'id' => 1,
+ 'api.event.get' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('participant', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function participant_get_expectedresult(){
+function participant_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'contact_id' => '2',
- 'contact_type' => 'Individual',
- 'contact_sub_type' => '',
- 'sort_name' => 'Anderson, Anthony',
- 'display_name' => 'Mr. Anthony Anderson II',
- 'event_id' => '6',
- 'event_title' => 'Annual CiviCRM meet',
- 'event_start_date' => '2013-07-29 00:00:00',
- 'event_end_date' => '2013-08-04 00:00:00',
- 'participant_id' => '1',
- 'participant_fee_level' => '',
- 'participant_fee_amount' => '',
- 'participant_fee_currency' => '',
- 'event_type' => 'Conference',
- 'participant_status_id' => '2',
- 'participant_status' => 'Attended',
- 'participant_role' => 'Attendee',
- 'participant_role_id' => '1',
- 'participant_register_date' => '2007-02-19 00:00:00',
- 'participant_source' => 'Wimbeldon',
- 'participant_note' => '',
- 'participant_is_pay_later' => 0,
- 'participant_is_test' => 0,
- 'participant_registered_by_id' => '',
- 'participant_discount_name' => '',
- 'participant_campaign_id' => '',
- 'id' => '1',
- 'api.event.get' => array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 6,
- 'values' => array(
- '0' => array(
- 'id' => '6',
- 'title' => 'Annual CiviCRM meet',
- 'event_title' => 'Annual CiviCRM meet',
- 'summary' => 'If you have any CiviCRM related issues or want to track where CiviCRM is heading, Sign up now',
- 'description' => 'This event is intended to give brief idea about progess of CiviCRM and giving solutions to common user issues',
- 'event_description' => 'This event is intended to give brief idea about progess of CiviCRM and giving solutions to common user issues',
- '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',
- 'end_date' => '2013-08-04 00:00:00',
- 'event_end_date' => '2013-08-04 00:00:00',
- 'is_online_registration' => '1',
- 'registration_start_date' => '2008-06-01 00:00:00',
- 'registration_end_date' => '2008-10-15 00:00:00',
- 'max_participants' => '100',
- 'event_full_text' => 'Sorry! We are already full',
- 'is_monetary' => 0,
- 'is_map' => 0,
- 'is_active' => '1',
- 'is_show_location' => 0,
- 'default_role_id' => '1',
- 'is_email_confirm' => 0,
- 'is_pay_later' => 0,
- 'is_partial_payment' => 0,
- 'is_multiple_registrations' => 0,
- 'allow_same_participant_emails' => 0,
- 'is_template' => 0,
- 'created_date' => '2013-07-28 08:49:19',
- 'is_share' => '1',
- 'is_confirm_enabled' => '1',
- ),
- ),
+ 'contact_id' => '2',
+ 'contact_type' => 'Individual',
+ 'contact_sub_type' => '',
+ 'sort_name' => 'Anderson, Anthony',
+ 'display_name' => 'Mr. Anthony Anderson II',
+ 'event_id' => '6',
+ 'event_title' => 'Annual CiviCRM meet',
+ 'event_start_date' => '2013-07-29 00:00:00',
+ 'event_end_date' => '2013-08-04 00:00:00',
+ 'participant_id' => '1',
+ 'participant_fee_level' => '',
+ 'participant_fee_amount' => '',
+ 'participant_fee_currency' => '',
+ 'event_type' => 'Conference',
+ 'participant_status_id' => '2',
+ 'participant_status' => 'Attended',
+ 'participant_role' => 'Attendee',
+ 'participant_role_id' => '1',
+ 'participant_register_date' => '2007-02-19 00:00:00',
+ 'participant_source' => 'Wimbeldon',
+ 'participant_note' => '',
+ 'participant_is_pay_later' => 0,
+ 'participant_is_test' => 0,
+ 'participant_registered_by_id' => '',
+ 'participant_discount_name' => '',
+ 'participant_campaign_id' => '',
+ 'id' => '1',
+ 'api.event.get' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 6,
+ 'values' => array(
+ '0' => array(
+ 'id' => '6',
+ 'title' => 'Annual CiviCRM meet',
+ 'event_title' => 'Annual CiviCRM meet',
+ 'summary' => 'If you have any CiviCRM related issues or want to track where CiviCRM is heading, Sign up now',
+ 'description' => 'This event is intended to give brief idea about progess of CiviCRM and giving solutions to common user issues',
+ 'event_description' => 'This event is intended to give brief idea about progess of CiviCRM and giving solutions to common user issues',
+ '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',
+ 'end_date' => '2013-08-04 00:00:00',
+ 'event_end_date' => '2013-08-04 00:00:00',
+ 'is_online_registration' => '1',
+ 'registration_start_date' => '2008-06-01 00:00:00',
+ 'registration_end_date' => '2008-10-15 00:00:00',
+ 'max_participants' => '100',
+ 'event_full_text' => 'Sorry! We are already full',
+ 'is_monetary' => 0,
+ 'is_map' => 0,
+ 'is_active' => '1',
+ 'is_show_location' => 0,
+ 'default_role_id' => '1',
+ 'is_email_confirm' => 0,
+ 'is_pay_later' => 0,
+ 'is_partial_payment' => 0,
+ 'is_multiple_registrations' => 0,
+ 'allow_same_participant_emails' => 0,
+ 'is_template' => 0,
+ 'created_date' => '2013-07-28 08:49:19',
+ 'is_share' => '1',
+ 'is_confirm_enabled' => '1',
+ 'is_billing_required' => 0,
),
+ ),
),
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetNestedEventGet and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetNestedEventGet
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ParticipantTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using participant_payment create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function participant_payment_create_example(){
-$params = array(
- 'participant_id' => 1,
- 'contribution_id' => 1,
-);
-try{
- $result = civicrm_api3('participant_payment', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using participant_payment create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function participant_payment_create_example() {
+ $params = array(
+ 'participant_id' => 13,
+ 'contribution_id' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('participant_payment', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function participant_payment_create_expectedresult(){
+function participant_payment_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'participant_id' => '1',
- 'contribution_id' => '1',
- ),
+ 'id' => '1',
+ 'participant_id' => '13',
+ 'contribution_id' => '1',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testPaymentCreate and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testPaymentCreate
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ParticipantPaymentTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using participant_payment delete API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function participant_payment_delete_example(){
-$params = array(
- 'id' => 1,
-);
-try{
- $result = civicrm_api3('participant_payment', 'delete', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using participant_payment delete API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function participant_payment_delete_example() {
+ $params = array(
+ 'id' => 5,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('participant_payment', 'delete', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function participant_payment_delete_expectedresult(){
+function participant_payment_delete_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'values' => 1,
-);
+ '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
-*
-* testPaymentDelete and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testPaymentDelete
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ParticipantPaymentTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using participant_payment get API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function participant_payment_get_example(){
-$params = array(
- 'participant_id' => 4,
- 'contribution_id' => 1,
-);
-try{
- $result = civicrm_api3('participant_payment', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using participant_payment get API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function participant_payment_get_example() {
+ $params = array(
+ 'participant_id' => 64,
+ 'contribution_id' => 6,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('participant_payment', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function participant_payment_get_expectedresult(){
+function participant_payment_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
- '1' => array(
- 'id' => '1',
- 'participant_id' => '4',
- 'contribution_id' => '1',
- ),
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 6,
+ 'values' => array(
+ '6' => array(
+ 'id' => '6',
+ 'participant_id' => '64',
+ 'contribution_id' => '6',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGet and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGet
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ParticipantPaymentTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using participant_status_type create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function participant_status_type_create_example(){
-$params = array(
- 'name' => 'test status',
- 'label' => 'I am a test',
- 'class' => 'Positive',
- 'is_reserved' => 0,
- 'is_active' => 1,
- 'is_counted' => 1,
- 'visibility_id' => 1,
- 'weight' => 10,
-);
-try{
- $result = civicrm_api3('participant_status_type', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using participant_status_type create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function participant_status_type_create_example() {
+ $params = array(
+ 'name' => 'test status',
+ 'label' => 'I am a test',
+ 'class' => 'Positive',
+ 'is_reserved' => 0,
+ 'is_active' => 1,
+ 'is_counted' => 1,
+ 'visibility_id' => 1,
+ 'weight' => 10,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('participant_status_type', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function participant_status_type_create_expectedresult(){
+function participant_status_type_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 16,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 16,
+ 'values' => array(
'16' => array(
- 'id' => '16',
- 'name' => 'test status',
- 'label' => 'I am a test',
- 'class' => '14',
- 'is_reserved' => 0,
- 'is_active' => '1',
- 'is_counted' => '1',
- 'weight' => '10',
- 'visibility_id' => '1',
- ),
+ 'id' => '16',
+ 'name' => 'test status',
+ 'label' => 'I am a test',
+ 'class' => '14',
+ 'is_reserved' => 0,
+ 'is_active' => '1',
+ 'is_counted' => '1',
+ 'weight' => '10',
+ 'visibility_id' => '1',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreateParticipantStatusType and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreateParticipantStatusType
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ParticipantStatusTypeTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using participant_status_type delete API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function participant_status_type_delete_example(){
-$params = array(
- 'id' => 17,
-);
-try{
- $result = civicrm_api3('participant_status_type', 'delete', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using participant_status_type delete API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function participant_status_type_delete_example() {
+ $params = array(
+ 'id' => 18,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('participant_status_type', 'delete', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function participant_status_type_delete_expectedresult(){
+function participant_status_type_delete_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'values' => true,
-);
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'values' => TRUE,
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testDeleteParticipantStatusType and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testDeleteParticipantStatusType
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ParticipantStatusTypeTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using participant_status_type get API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function participant_status_type_get_example(){
-$params = array(
- 'name' => 'test status',
- 'label' => 'I am a test',
- 'class' => 'Positive',
- 'is_reserved' => 0,
- 'is_active' => 1,
- 'is_counted' => 1,
- 'visibility_id' => 1,
- 'weight' => 10,
-);
-try{
- $result = civicrm_api3('participant_status_type', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using participant_status_type get API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function participant_status_type_get_example() {
+ $params = array(
+ 'name' => 'test status',
+ 'label' => 'I am a test',
+ 'class' => 'Positive',
+ 'is_reserved' => 0,
+ 'is_active' => 1,
+ 'is_counted' => 1,
+ 'visibility_id' => 1,
+ 'weight' => 10,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('participant_status_type', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function participant_status_type_get_expectedresult(){
+function participant_status_type_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 16,
- 'values' => array(
- '16' => array(
- 'id' => '16',
- 'name' => 'test status',
- 'label' => 'I am a test',
- 'class' => '14',
- 'is_reserved' => 0,
- 'is_active' => '1',
- 'is_counted' => '1',
- 'weight' => '10',
- 'visibility_id' => '1',
- ),
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 17,
+ 'values' => array(
+ '17' => array(
+ 'id' => '17',
+ 'name' => 'test status',
+ 'label' => 'I am a test',
+ 'class' => '14',
+ 'is_reserved' => 0,
+ 'is_active' => '1',
+ 'is_counted' => '1',
+ 'weight' => '10',
+ 'visibility_id' => '1',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetParticipantStatusType and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetParticipantStatusType
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ParticipantStatusTypeTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using payment_processor create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function payment_processor_create_example(){
-$params = array(
- 'name' => 'API Test PP',
- 'payment_processor_type_id' => 1,
- 'class_name' => 'CRM_Core_Payment_APITest',
- 'is_recur' => 0,
- 'domain_id' => 1,
-);
-try{
- $result = civicrm_api3('payment_processor', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using payment_processor create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function payment_processor_create_example() {
+ $params = array(
+ 'name' => 'API Test PP',
+ 'payment_processor_type_id' => 18,
+ 'class_name' => 'CRM_Core_Payment_APITest',
+ 'is_recur' => 0,
+ 'domain_id' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('payment_processor', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function payment_processor_create_expectedresult(){
+function payment_processor_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
- '1' => array(
- 'id' => '1',
- 'domain_id' => '1',
- 'name' => 'API Test PP',
- 'description' => '',
- 'payment_processor_type_id' => '1',
- 'is_active' => '',
- 'is_default' => 0,
- 'is_test' => 0,
- 'user_name' => '',
- 'password' => '',
- 'signature' => '',
- 'url_site' => '',
- 'url_api' => '',
- 'url_recur' => '',
- 'url_button' => '',
- 'subject' => '',
- 'class_name' => 'CRM_Core_Payment_APITest',
- 'billing_mode' => '1',
- 'is_recur' => 0,
- 'payment_type' => '1',
- ),
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 2,
+ 'values' => array(
+ '2' => array(
+ 'id' => '2',
+ 'domain_id' => '1',
+ 'name' => 'API Test PP',
+ 'description' => '',
+ 'payment_processor_type_id' => '18',
+ 'is_active' => '',
+ 'is_default' => 0,
+ 'is_test' => 0,
+ 'user_name' => '',
+ 'password' => '',
+ 'signature' => '',
+ 'url_site' => '',
+ 'url_api' => '',
+ 'url_recur' => '',
+ 'url_button' => '',
+ 'subject' => '',
+ 'class_name' => 'CRM_Core_Payment_APITest',
+ 'billing_mode' => '1',
+ 'is_recur' => 0,
+ 'payment_type' => '1',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testPaymentProcessorCreate and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testPaymentProcessorCreate
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PaymentProcessorTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using payment_processor delete API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function payment_processor_delete_example(){
-$params = array(
- 'id' => 1,
-);
-try{
- $result = civicrm_api3('payment_processor', 'delete', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using payment_processor delete API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function payment_processor_delete_example() {
+ $params = array(
+ 'id' => 2,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('payment_processor', 'delete', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function payment_processor_delete_expectedresult(){
+function payment_processor_delete_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'values' => true,
-);
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'values' => TRUE,
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testPaymentProcessorDelete and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testPaymentProcessorDelete
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PaymentProcessorTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using payment_processor_type create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function payment_processor_type_create_example(){
-$params = array(
- 'sequential' => 1,
- 'name' => 'API_Test_PP',
- 'title' => 'API Test Payment Processor',
- 'class_name' => 'CRM_Core_Payment_APITest',
- 'billing_mode' => 'form',
- 'is_recur' => 0,
-);
-try{
- $result = civicrm_api3('payment_processor_type', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using payment_processor_type create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function payment_processor_type_create_example() {
+ $params = array(
+ 'sequential' => 1,
+ 'name' => 'API_Test_PP',
+ 'title' => 'API Test Payment Processor',
+ 'class_name' => 'CRM_Core_Payment_APITest',
+ 'billing_mode' => 'form',
+ 'is_recur' => 0,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('payment_processor_type', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function payment_processor_type_create_expectedresult(){
+function payment_processor_type_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 15,
+ 'values' => array(
'0' => array(
- 'id' => '1',
- 'name' => 'API_Test_PP',
- 'title' => 'API Test Payment Processor',
- 'description' => '',
- 'is_active' => '1',
- 'is_default' => '',
- 'user_name_label' => '',
- 'password_label' => '',
- 'signature_label' => '',
- 'subject_label' => '',
- 'class_name' => 'CRM_Core_Payment_APITest',
- 'url_site_default' => '',
- 'url_api_default' => '',
- 'url_recur_default' => '',
- 'url_button_default' => '',
- 'url_site_test_default' => '',
- 'url_api_test_default' => '',
- 'url_recur_test_default' => '',
- 'url_button_test_default' => '',
- 'billing_mode' => '1',
- 'is_recur' => 0,
- 'payment_type' => '',
- ),
+ 'id' => '15',
+ 'name' => 'API_Test_PP',
+ 'title' => 'API Test Payment Processor',
+ 'description' => '',
+ 'is_active' => '1',
+ 'is_default' => '',
+ 'user_name_label' => '',
+ 'password_label' => '',
+ 'signature_label' => '',
+ 'subject_label' => '',
+ 'class_name' => 'CRM_Core_Payment_APITest',
+ 'url_site_default' => '',
+ 'url_api_default' => '',
+ 'url_recur_default' => '',
+ 'url_button_default' => '',
+ 'url_site_test_default' => '',
+ 'url_api_test_default' => '',
+ 'url_recur_test_default' => '',
+ 'url_button_test_default' => '',
+ 'billing_mode' => '1',
+ 'is_recur' => 0,
+ 'payment_type' => '',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testPaymentProcessorTypeCreate and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testPaymentProcessorTypeCreate
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PaymentProcessorTypeTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using payment_processor_type delete API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function payment_processor_type_delete_example(){
-$params = array(
- 'id' => 1,
-);
-try{
- $result = civicrm_api3('payment_processor_type', 'delete', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using payment_processor_type delete API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function payment_processor_type_delete_example() {
+ $params = array(
+ 'id' => 17,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('payment_processor_type', 'delete', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function payment_processor_type_delete_expectedresult(){
+function payment_processor_type_delete_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'values' => true,
-);
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'values' => TRUE,
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testPaymentProcessorTypeDelete and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testPaymentProcessorTypeDelete
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PaymentProcessorTypeTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using phone create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function phone_create_example(){
-$params = array(
- 'contact_id' => 3,
- 'location_type_id' => 6,
- 'phone' => '(123) 456-7890',
- 'is_primary' => 1,
- 'phone_type_id' => 1,
-);
-try{
- $result = civicrm_api3('phone', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using phone create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function phone_create_example() {
+ $params = array(
+ 'contact_id' => 3,
+ 'location_type_id' => 6,
+ 'phone' => '(123) 456-7890',
+ 'is_primary' => 1,
+ 'phone_type_id' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('phone', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function phone_create_expectedresult(){
+function phone_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' => '6',
- 'is_primary' => '1',
- 'is_billing' => '',
- 'mobile_provider_id' => '',
- 'phone' => '(123) 456-7890',
- 'phone_ext' => '',
- 'phone_numeric' => '',
- 'phone_type_id' => '1',
- ),
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 2,
+ 'values' => array(
+ '2' => array(
+ 'id' => '2',
+ 'contact_id' => '3',
+ 'location_type_id' => '6',
+ 'is_primary' => '1',
+ 'is_billing' => '',
+ 'mobile_provider_id' => '',
+ 'phone' => '(123) 456-7890',
+ 'phone_ext' => '',
+ 'phone_numeric' => '',
+ 'phone_type_id' => '1',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreatePhone and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreatePhone
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PhoneTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using phone delete API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function phone_delete_example(){
-$params = array(
- 'id' => 1,
-);
-try{
- $result = civicrm_api3('phone', 'delete', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using phone delete API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function phone_delete_example() {
+ $params = array(
+ 'id' => 3,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('phone', 'delete', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function phone_delete_expectedresult(){
+function phone_delete_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'values' => true,
-);
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'values' => TRUE,
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testDeletePhone and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testDeletePhone
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PhoneTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using phone get API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function phone_get_example(){
-$params = array(
- 'contact_id' => 7,
- 'phone' => '(123) 456-7890',
-);
-try{
- $result = civicrm_api3('phone', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using phone get API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function phone_get_example() {
+ $params = array(
+ 'contact_id' => 7,
+ 'phone' => '(123) 456-7890',
+ );
-return $result;
+ try{
+ $result = civicrm_api3('phone', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function phone_get_expectedresult(){
+function phone_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
- '1' => array(
- 'id' => '1',
- 'contact_id' => '7',
- 'location_type_id' => '10',
- 'is_primary' => '1',
- 'is_billing' => 0,
- 'phone' => '(123) 456-7890',
- 'phone_numeric' => '1234567890',
- 'phone_type_id' => '1',
- ),
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 4,
+ 'values' => array(
+ '4' => array(
+ 'id' => '4',
+ 'contact_id' => '7',
+ 'location_type_id' => '10',
+ 'is_primary' => '1',
+ 'is_billing' => 0,
+ 'phone' => '(123) 456-7890',
+ 'phone_numeric' => '1234567890',
+ 'phone_type_id' => '1',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGet and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGet
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PhoneTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using pledge create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function pledge_create_example(){
-$params = array(
- 'contact_id' => 11,
- 'pledge_create_date' => '20140928',
- 'start_date' => '20140928',
- 'scheduled_date' => '20140930',
- 'amount' => '100',
- 'pledge_status_id' => '2',
- 'pledge_financial_type_id' => '1',
- 'pledge_original_installment_amount' => 20,
- 'frequency_interval' => 5,
- 'frequency_unit' => 'year',
- 'frequency_day' => 15,
- 'installments' => 5,
- 'sequential' => 1,
-);
-try{
- $result = civicrm_api3('pledge', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using pledge create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function pledge_create_example() {
+ $params = array(
+ 'contact_id' => 11,
+ 'pledge_create_date' => '20150115',
+ 'start_date' => '20150115',
+ 'scheduled_date' => '20150117',
+ 'amount' => '100',
+ 'pledge_status_id' => '2',
+ 'pledge_financial_type_id' => '1',
+ 'pledge_original_installment_amount' => 20,
+ 'frequency_interval' => 5,
+ 'frequency_unit' => 'year',
+ 'frequency_day' => 15,
+ 'installments' => 5,
+ 'sequential' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('pledge', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function pledge_create_expectedresult(){
+function pledge_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'0' => array(
- 'id' => '1',
- 'contact_id' => '11',
- 'financial_type_id' => '1',
- 'contribution_page_id' => '',
- 'amount' => '100',
- 'original_installment_amount' => '20',
- 'currency' => 'USD',
- 'frequency_unit' => 'year',
- 'frequency_interval' => '5',
- 'frequency_day' => '15',
- 'installments' => '5',
- 'start_date' => '2013-07-29 00:00:00',
- 'create_date' => '20120130621222105',
- 'acknowledge_date' => '',
- 'modified_date' => '',
- 'cancel_date' => '',
- 'end_date' => '',
- 'max_reminders' => '',
- 'initial_reminder_day' => '',
- 'additional_reminder_day' => '',
- 'status_id' => '2',
- 'is_test' => '',
- 'campaign_id' => '',
- ),
+ 'id' => '1',
+ 'contact_id' => '11',
+ 'financial_type_id' => '1',
+ 'contribution_page_id' => '',
+ 'amount' => '100',
+ 'original_installment_amount' => '20',
+ 'currency' => 'USD',
+ 'frequency_unit' => 'year',
+ 'frequency_interval' => '5',
+ 'frequency_day' => '15',
+ 'installments' => '5',
+ 'start_date' => '2013-07-29 00:00:00',
+ 'create_date' => '20120130621222105',
+ 'acknowledge_date' => '',
+ 'modified_date' => '',
+ 'cancel_date' => '',
+ 'end_date' => '',
+ 'max_reminders' => '',
+ 'initial_reminder_day' => '',
+ 'additional_reminder_day' => '',
+ 'status_id' => '2',
+ 'is_test' => '',
+ 'campaign_id' => '',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreatePledge and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreatePledge
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PledgeTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using pledge delete API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function pledge_delete_example(){
-$params = array(
- 'id' => 1,
-);
-try{
- $result = civicrm_api3('pledge', 'delete', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using pledge delete API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function pledge_delete_example() {
+ $params = array(
+ 'id' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('pledge', 'delete', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function pledge_delete_expectedresult(){
+function pledge_delete_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 'id',
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 'id',
+ 'values' => array(
'id' => 1,
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testDeletePledgeUseID and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testDeletePledgeUseID
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PledgeTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using pledge get API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function pledge_get_example(){
-$params = array(
- 'pledge_id' => 1,
-);
-try{
- $result = civicrm_api3('pledge', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using pledge get API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function pledge_get_example() {
+ $params = array(
+ 'pledge_id' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('pledge', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function pledge_get_expectedresult(){
+function pledge_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'contact_id' => '5',
- 'contact_type' => 'Individual',
- 'contact_sub_type' => '',
- 'sort_name' => 'Anderson, Anthony',
- 'display_name' => 'Mr. Anthony Anderson II',
- 'pledge_id' => '1',
- 'pledge_amount' => '100.00',
- 'pledge_create_date' => '2014-09-28 00:00:00',
- 'pledge_status' => 'Pending',
- 'pledge_total_paid' => '',
- 'pledge_next_pay_date' => '2014-09-30 00:00:00',
- 'pledge_next_pay_amount' => '20.00',
- 'pledge_outstanding_amount' => '',
- 'pledge_financial_type' => 'Donation',
- 'pledge_contribution_page_id' => '',
- 'pledge_frequency_interval' => '5',
- 'pledge_frequency_unit' => 'year',
- 'pledge_is_test' => 0,
- 'pledge_campaign_id' => '',
- 'pledge_currency' => 'USD',
- 'id' => '1',
- ),
+ 'contact_id' => '5',
+ 'contact_type' => 'Individual',
+ 'contact_sub_type' => '',
+ 'sort_name' => 'Anderson, Anthony',
+ 'display_name' => 'Mr. Anthony Anderson II',
+ 'pledge_id' => '1',
+ 'pledge_amount' => '100.00',
+ 'pledge_create_date' => '2015-01-15 00:00:00',
+ 'pledge_status' => 'Pending',
+ 'pledge_total_paid' => '',
+ 'pledge_next_pay_date' => '2015-01-17 00:00:00',
+ 'pledge_next_pay_amount' => '20.00',
+ 'pledge_outstanding_amount' => '',
+ 'pledge_financial_type' => 'Donation',
+ 'pledge_contribution_page_id' => '',
+ 'pledge_frequency_interval' => '5',
+ 'pledge_frequency_unit' => 'year',
+ 'pledge_is_test' => 0,
+ 'pledge_campaign_id' => '',
+ 'pledge_currency' => 'USD',
+ 'id' => '1',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetPledge and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetPledge
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PledgeTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using pledge get API
- * demonstrates high date filter *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function pledge_get_example(){
-$params = array(
- 'pledge_start_date_high' => '20140926232809',
-);
-try{
- $result = civicrm_api3('pledge', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using pledge get API.
+ *
+ * demonstrates high date filter
+ *
+ * @return array
+ * API result array
+ */
+function pledge_get_example() {
+ $params = array(
+ 'pledge_start_date_high' => '20150113034845',
+ );
-return $result;
+ try{
+ $result = civicrm_api3('pledge', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function pledge_get_expectedresult(){
+function pledge_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 2,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 2,
+ 'values' => array(
'2' => array(
- 'contact_id' => '8',
- 'contact_type' => 'Individual',
- 'contact_sub_type' => '',
- 'sort_name' => 'Anderson, Anthony',
- 'display_name' => 'Mr. Anthony Anderson II',
- 'pledge_id' => '2',
- 'pledge_amount' => '100.00',
- 'pledge_create_date' => '2014-09-28 00:00:00',
- 'pledge_status' => 'Overdue',
- 'pledge_total_paid' => '',
- 'pledge_next_pay_date' => '2013-03-01 00:00:00',
- 'pledge_next_pay_amount' => '20.00',
- 'pledge_outstanding_amount' => '20.00',
- 'pledge_financial_type' => 'Donation',
- 'pledge_contribution_page_id' => '',
- 'pledge_frequency_interval' => '5',
- 'pledge_frequency_unit' => 'year',
- 'pledge_is_test' => 0,
- 'pledge_campaign_id' => '',
- 'pledge_currency' => 'USD',
- 'id' => '2',
- ),
+ 'contact_id' => '8',
+ 'contact_type' => 'Individual',
+ 'contact_sub_type' => '',
+ 'sort_name' => 'Anderson, Anthony',
+ 'display_name' => 'Mr. Anthony Anderson II',
+ 'pledge_id' => '2',
+ 'pledge_amount' => '100.00',
+ 'pledge_create_date' => '2015-01-15 00:00:00',
+ 'pledge_status' => 'Overdue',
+ 'pledge_total_paid' => '',
+ 'pledge_next_pay_date' => '2014-03-07 00:00:00',
+ 'pledge_next_pay_amount' => '20.00',
+ 'pledge_outstanding_amount' => '20.00',
+ 'pledge_financial_type' => 'Donation',
+ 'pledge_contribution_page_id' => '',
+ 'pledge_frequency_interval' => '5',
+ 'pledge_frequency_unit' => 'year',
+ 'pledge_is_test' => 0,
+ 'pledge_campaign_id' => '',
+ 'pledge_currency' => 'USD',
+ 'id' => '2',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testPledgeGetReturnFilters and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testPledgeGetReturnFilters
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PledgeTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using pledge_payment create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function pledge_payment_create_example(){
-$params = array(
- 'contact_id' => 1,
- 'pledge_id' => 1,
- 'contribution_id' => 1,
- 'status_id' => 1,
- 'actual_amount' => 20,
-);
-try{
- $result = civicrm_api3('pledge_payment', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using pledge_payment create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function pledge_payment_create_example() {
+ $params = array(
+ 'contact_id' => 1,
+ 'pledge_id' => 1,
+ 'contribution_id' => 1,
+ 'status_id' => 1,
+ 'actual_amount' => 20,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('pledge_payment', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function pledge_payment_create_expectedresult(){
+function pledge_payment_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'pledge_id' => '1',
- 'contribution_id' => '1',
- 'scheduled_amount' => '',
- 'actual_amount' => '20',
- 'currency' => 'USD',
- 'scheduled_date' => '',
- 'reminder_date' => '',
- 'reminder_count' => '',
- 'status_id' => '1',
- ),
+ 'id' => '1',
+ 'pledge_id' => '1',
+ 'contribution_id' => '1',
+ 'scheduled_amount' => '',
+ 'actual_amount' => '20',
+ 'currency' => 'USD',
+ 'scheduled_date' => '',
+ 'reminder_date' => '',
+ 'reminder_count' => '',
+ 'status_id' => '1',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreatePledgePayment and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreatePledgePayment
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PledgePaymentTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using pledge_payment delete API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function pledge_payment_delete_example(){
-$params = array(
- 'id' => 1,
-);
-try{
- $result = civicrm_api3('pledge_payment', 'delete', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using pledge_payment delete API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function pledge_payment_delete_example() {
+ $params = array(
+ 'id' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('pledge_payment', 'delete', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function pledge_payment_delete_expectedresult(){
+function pledge_payment_delete_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 'id',
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 'id',
+ 'values' => array(
'id' => 1,
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testDeletePledgePayment and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testDeletePledgePayment
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PledgePaymentTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using pledge_payment get API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function pledge_payment_get_example(){
-$params = array();
-try{
- $result = civicrm_api3('pledge_payment', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using pledge_payment get API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function pledge_payment_get_example() {
+ $params = array();
-return $result;
+ try{
+ $result = civicrm_api3('pledge_payment', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function pledge_payment_get_expectedresult(){
+function pledge_payment_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 5,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 5,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'pledge_id' => '1',
- 'scheduled_amount' => '20.00',
- 'currency' => 'USD',
- 'scheduled_date' => '20130728085413',
- 'reminder_count' => 0,
- 'status_id' => '2',
- ),
+ 'id' => '1',
+ 'pledge_id' => '1',
+ 'scheduled_amount' => '20.00',
+ 'currency' => 'USD',
+ 'scheduled_date' => '20130728085413',
+ 'reminder_count' => 0,
+ 'status_id' => '2',
+ ),
'2' => array(
- 'id' => '2',
- 'pledge_id' => '1',
- 'scheduled_amount' => '20.00',
- 'currency' => 'USD',
- 'scheduled_date' => '20130728085413',
- 'reminder_count' => 0,
- 'status_id' => '2',
- ),
+ 'id' => '2',
+ 'pledge_id' => '1',
+ 'scheduled_amount' => '20.00',
+ 'currency' => 'USD',
+ 'scheduled_date' => '20130728085413',
+ 'reminder_count' => 0,
+ 'status_id' => '2',
+ ),
'3' => array(
- 'id' => '3',
- 'pledge_id' => '1',
- 'scheduled_amount' => '20.00',
- 'currency' => 'USD',
- 'scheduled_date' => '20130728085413',
- 'reminder_count' => 0,
- 'status_id' => '2',
- ),
+ 'id' => '3',
+ 'pledge_id' => '1',
+ 'scheduled_amount' => '20.00',
+ 'currency' => 'USD',
+ 'scheduled_date' => '20130728085413',
+ 'reminder_count' => 0,
+ 'status_id' => '2',
+ ),
'4' => array(
- 'id' => '4',
- 'pledge_id' => '1',
- 'scheduled_amount' => '20.00',
- 'currency' => 'USD',
- 'scheduled_date' => '20130728085413',
- 'reminder_count' => 0,
- 'status_id' => '2',
- ),
+ 'id' => '4',
+ 'pledge_id' => '1',
+ 'scheduled_amount' => '20.00',
+ 'currency' => 'USD',
+ 'scheduled_date' => '20130728085413',
+ 'reminder_count' => 0,
+ 'status_id' => '2',
+ ),
'5' => array(
- 'id' => '5',
- 'pledge_id' => '1',
- 'scheduled_amount' => '20.00',
- 'currency' => 'USD',
- 'scheduled_date' => '20130728085413',
- 'reminder_count' => 0,
- 'status_id' => '2',
- ),
+ 'id' => '5',
+ 'pledge_id' => '1',
+ 'scheduled_amount' => '20.00',
+ 'currency' => 'USD',
+ 'scheduled_date' => '20130728085413',
+ 'reminder_count' => 0,
+ 'status_id' => '2',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetPledgePayment and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetPledgePayment
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PledgePaymentTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using pledge_payment update API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function pledge_payment_update_example(){
-$params = array(
- 'id' => 1,
- 'status_id' => 1,
-);
-try{
- $result = civicrm_api3('pledge_payment', 'update', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using pledge_payment update API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function pledge_payment_update_example() {
+ $params = array(
+ 'id' => 1,
+ 'status_id' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('pledge_payment', 'update', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function pledge_payment_update_expectedresult(){
+function pledge_payment_update_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'pledge_id' => '1',
- 'contribution_id' => '1',
- 'scheduled_amount' => '20.00',
- 'actual_amount' => '20.00',
- 'currency' => 'USD',
- 'scheduled_date' => '20130728085413',
- 'reminder_date' => '',
- 'reminder_count' => 0,
- 'status_id' => '1',
- ),
+ 'id' => '1',
+ 'pledge_id' => '1',
+ 'contribution_id' => '1',
+ 'scheduled_amount' => '20.00',
+ 'actual_amount' => '20.00',
+ 'currency' => 'USD',
+ 'scheduled_date' => '20130728085413',
+ 'reminder_date' => '',
+ 'reminder_count' => 0,
+ 'status_id' => '1',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testUpdatePledgePayment and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testUpdatePledgePayment
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PledgePaymentTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using price_field create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function price_field_create_example(){
-$params = array(
- 'price_set_id' => 3,
- 'name' => 'grassvariety',
- 'label' => 'Grass Variety',
- 'html_type' => 'Text',
- 'is_enter_qty' => 1,
- 'is_active' => 1,
-);
-try{
- $result = civicrm_api3('price_field', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using price_field create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function price_field_create_example() {
+ $params = array(
+ 'price_set_id' => 3,
+ 'name' => 'grassvariety',
+ 'label' => 'Grass Variety',
+ 'html_type' => 'Text',
+ 'is_enter_qty' => 1,
+ 'is_active' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('price_field', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function price_field_create_expectedresult(){
+function price_field_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 2,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 2,
+ 'values' => array(
'2' => array(
- 'id' => '2',
- 'price_set_id' => '3',
- 'name' => 'grassvariety',
- 'label' => 'Grass Variety',
- 'html_type' => 'Text',
- 'is_enter_qty' => '1',
- 'help_pre' => '',
- 'help_post' => '',
- 'weight' => '',
- 'is_display_amounts' => '',
- 'options_per_line' => '',
- 'is_active' => '1',
- 'is_required' => '',
- 'active_on' => '',
- 'expire_on' => '',
- 'javascript' => '',
- 'visibility_id' => '',
- ),
+ 'id' => '2',
+ 'price_set_id' => '3',
+ 'name' => 'grassvariety',
+ 'label' => 'Grass Variety',
+ 'html_type' => 'Text',
+ 'is_enter_qty' => '1',
+ 'help_pre' => '',
+ 'help_post' => '',
+ 'weight' => '',
+ 'is_display_amounts' => '',
+ 'options_per_line' => '',
+ 'is_active' => '1',
+ 'is_required' => '',
+ 'active_on' => '',
+ 'expire_on' => '',
+ 'javascript' => '',
+ 'visibility_id' => '',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreatePriceField and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreatePriceField
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PriceFieldTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using price_field delete API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function price_field_delete_example(){
-$params = array(
- 'id' => 4,
-);
-try{
- $result = civicrm_api3('price_field', 'delete', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using price_field delete API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function price_field_delete_example() {
+ $params = array(
+ 'id' => 4,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('price_field', 'delete', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function price_field_delete_expectedresult(){
+function price_field_delete_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'values' => 1,
-);
+ '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
-*
-* testDeletePriceField and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testDeletePriceField
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PriceFieldTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using price_field get API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function price_field_get_example(){
-$params = array(
- 'name' => 'contribution_amount',
-);
-try{
- $result = civicrm_api3('price_field', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using price_field get API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function price_field_get_example() {
+ $params = array(
+ 'name' => 'contribution_amount',
+ );
-return $result;
+ try{
+ $result = civicrm_api3('price_field', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function price_field_get_expectedresult(){
+function price_field_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'price_set_id' => '1',
- 'name' => 'contribution_amount',
- 'label' => 'Contribution Amount',
- 'html_type' => 'Text',
- 'is_enter_qty' => 0,
- 'weight' => '1',
- 'is_display_amounts' => '1',
- 'options_per_line' => '1',
- 'is_active' => '1',
- 'is_required' => '1',
- 'visibility_id' => '1',
- ),
+ 'id' => '1',
+ 'price_set_id' => '1',
+ 'name' => 'contribution_amount',
+ 'label' => 'Contribution Amount',
+ 'html_type' => 'Text',
+ 'is_enter_qty' => 0,
+ 'weight' => '1',
+ 'is_display_amounts' => '1',
+ 'options_per_line' => '1',
+ 'is_active' => '1',
+ 'is_required' => '1',
+ 'visibility_id' => '1',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetBasicPriceField and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetBasicPriceField
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PriceFieldTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using price_field_value create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function price_field_value_create_example(){
-$params = array(
- 'price_field_id' => 13,
- 'membership_type_id' => 5,
- 'name' => 'memType1',
- 'label' => 'memType1',
- 'amount' => 90,
- 'membership_num_terms' => 2,
- 'is_active' => 1,
- 'financial_type_id' => 2,
-);
-try{
- $result = civicrm_api3('price_field_value', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using price_field_value create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function price_field_value_create_example() {
+ $params = array(
+ 'price_field_id' => 13,
+ 'membership_type_id' => 5,
+ 'name' => 'memType1',
+ 'label' => 'memType1',
+ 'amount' => 90,
+ 'membership_num_terms' => 2,
+ 'is_active' => 1,
+ 'financial_type_id' => 2,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('price_field_value', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function price_field_value_create_expectedresult(){
+function price_field_value_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 10,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 10,
+ 'values' => array(
'10' => array(
- 'id' => '10',
- 'price_field_id' => '13',
- 'name' => 'memType1',
- 'label' => 'memType1',
- 'description' => '',
- 'amount' => '90',
- 'count' => '',
- 'max_value' => '',
- 'weight' => '1',
- 'membership_type_id' => '5',
- 'membership_num_terms' => '2',
- 'is_default' => '',
- 'is_active' => '1',
- 'financial_type_id' => '2',
- 'deductible_amount' => '',
- 'contribution_type_id' => '2',
- ),
+ 'id' => '10',
+ 'price_field_id' => '13',
+ 'name' => 'memType1',
+ 'label' => 'memType1',
+ 'description' => '',
+ 'amount' => '90',
+ 'count' => '',
+ 'max_value' => '',
+ 'weight' => '1',
+ 'membership_type_id' => '5',
+ 'membership_num_terms' => '2',
+ 'is_default' => '',
+ 'is_active' => '1',
+ 'financial_type_id' => '2',
+ 'deductible_amount' => '',
+ 'contribution_type_id' => '2',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreatePriceFieldValuewithMultipleTerms and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreatePriceFieldValuewithMultipleTerms
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PriceFieldValueTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using price_field_value delete API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function price_field_value_delete_example(){
-$params = array(
- 'id' => 7,
-);
-try{
- $result = civicrm_api3('price_field_value', 'delete', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using price_field_value delete API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function price_field_value_delete_example() {
+ $params = array(
+ 'id' => 7,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('price_field_value', 'delete', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function price_field_value_delete_expectedresult(){
+function price_field_value_delete_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'values' => true,
-);
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'values' => TRUE,
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testDeletePriceFieldValue and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testDeletePriceFieldValue
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PriceFieldValueTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using price_field_value get API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function price_field_value_get_example(){
-$params = array(
- 'name' => 'contribution_amount',
-);
-try{
- $result = civicrm_api3('price_field_value', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using price_field_value get API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function price_field_value_get_example() {
+ $params = array(
+ 'name' => 'contribution_amount',
+ );
-return $result;
+ try{
+ $result = civicrm_api3('price_field_value', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function price_field_value_get_expectedresult(){
+function price_field_value_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'price_field_id' => '1',
- 'name' => 'contribution_amount',
- 'label' => 'Contribution Amount',
- 'amount' => '1',
- 'weight' => '1',
- 'is_default' => 0,
- 'is_active' => '1',
- 'financial_type_id' => '1',
- 'deductible_amount' => '0.00',
- ),
+ 'id' => '1',
+ 'price_field_id' => '1',
+ 'name' => 'contribution_amount',
+ 'label' => 'Contribution Amount',
+ 'amount' => '1',
+ 'weight' => '1',
+ 'is_default' => 0,
+ 'is_active' => '1',
+ 'financial_type_id' => '1',
+ 'deductible_amount' => '0.00',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetBasicPriceFieldValue and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetBasicPriceFieldValue
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PriceFieldValueTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using price_set create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function price_set_create_example(){
-$params = array(
- 'name' => 'default_goat_priceset',
- 'title' => 'Goat accessories',
- 'is_active' => 1,
- 'help_pre' => 'Please describe your goat in detail',
- 'help_post' => 'thank you for your time',
- 'extends' => 2,
- 'financial_type_id' => 1,
- 'is_quick_config' => 1,
- 'is_reserved' => 1,
-);
-try{
- $result = civicrm_api3('price_set', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using price_set create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function price_set_create_example() {
+ $params = array(
+ 'name' => 'some_price_set',
+ 'title' => 'Some Price Set',
+ 'is_active' => 1,
+ 'financial_type_id' => 1,
+ 'extends' => array(
+ '0' => 1,
+ '1' => 2,
+ ),
+ );
-return $result;
+ try{
+ $result = civicrm_api3('price_set', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function price_set_create_expectedresult(){
+function price_set_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 15,
- 'values' => array(
- '15' => array(
- 'id' => '15',
- 'domain_id' => '',
- 'name' => 'default_goat_priceset',
- 'title' => 'Goat accessories',
- 'is_active' => '1',
- 'help_pre' => 'Please describe your goat in detail',
- 'help_post' => 'thank you for your time',
- 'javascript' => '',
- 'extends' => '2',
- 'financial_type_id' => '1',
- 'is_quick_config' => '1',
- 'is_reserved' => '1',
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 16,
+ 'values' => array(
+ '16' => array(
+ 'id' => '16',
+ 'domain_id' => '',
+ 'name' => 'some_price_set',
+ 'title' => 'Some Price Set',
+ 'is_active' => '1',
+ 'help_pre' => '',
+ 'help_post' => '',
+ 'javascript' => '',
+ 'extends' => array(
+ '0' => '1',
+ '1' => '2',
),
+ 'financial_type_id' => '1',
+ 'is_quick_config' => '',
+ 'is_reserved' => '',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreatePriceSet and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreatePriceSetForEventAndContribution
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PriceSetTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using price_set delete API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function price_set_delete_example(){
-$params = array(
- 'id' => 18,
-);
-try{
- $result = civicrm_api3('price_set', 'delete', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using price_set delete API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function price_set_delete_example() {
+ $params = array(
+ 'id' => 19,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('price_set', 'delete', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function price_set_delete_expectedresult(){
+function price_set_delete_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'values' => 1,
-);
+ '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
-*
-* testDeletePriceSet and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testDeletePriceSet
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PriceSetTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using price_set get API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function price_set_get_example(){
-$params = array(
- 'name' => 'default_contribution_amount',
-);
-try{
- $result = civicrm_api3('price_set', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using price_set get API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function price_set_get_example() {
+ $params = array(
+ 'name' => 'default_contribution_amount',
+ );
-return $result;
+ try{
+ $result = civicrm_api3('price_set', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function price_set_get_expectedresult(){
+function price_set_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'name' => 'default_contribution_amount',
- 'title' => 'Contribution Amount',
- 'is_active' => '1',
- 'extends' => '2',
- 'is_quick_config' => '1',
- 'is_reserved' => '1',
- 'entity' => array(),
- ),
+ 'id' => '1',
+ 'name' => 'default_contribution_amount',
+ 'title' => 'Contribution Amount',
+ 'is_active' => '1',
+ 'extends' => '2',
+ 'is_quick_config' => '1',
+ 'is_reserved' => '1',
+ 'entity' => array(),
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetBasicPriceSet and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetBasicPriceSet
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PriceSetTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using profile apply API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function profile_apply_example(){
-$params = array(
- 'profile_id' => 31,
- 'contact_id' => 3,
- 'first_name' => 'abc2',
- 'last_name' => 'xyz2',
- 'email-Primary' => 'abc2.xyz2@gmail.com',
- 'phone-1-1' => '022 321 826',
- 'country-1' => '1013',
- 'state_province-1' => '1000',
-);
-try{
- $result = civicrm_api3('profile', 'apply', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using profile apply API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function profile_apply_example() {
+ $params = array(
+ 'profile_id' => 31,
+ 'contact_id' => 3,
+ 'first_name' => 'abc2',
+ 'last_name' => 'xyz2',
+ 'email-Primary' => 'abc2.xyz2@gmail.com',
+ 'phone-1-1' => '022 321 826',
+ 'country-1' => '1013',
+ 'state_province-1' => '1000',
+ );
-return $result;
+ try{
+ $result = civicrm_api3('profile', 'apply', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function profile_apply_expectedresult(){
+function profile_apply_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 11,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 11,
+ 'values' => array(
'contact_type' => 'Individual',
'contact_sub_type' => '',
'contact_id' => 3,
'first_name' => 'abc2',
'last_name' => 'xyz2',
'email' => array(
- '1' => array(
- 'location_type_id' => '1',
- 'is_primary' => 1,
- 'email' => 'abc2.xyz2@gmail.com',
- ),
+ '1' => array(
+ 'location_type_id' => '1',
+ 'is_primary' => 1,
+ 'email' => 'abc2.xyz2@gmail.com',
),
+ ),
'phone' => array(
- '2' => array(
- 'location_type_id' => '1',
- 'is_primary' => 1,
- 'phone_type_id' => '1',
- 'phone' => '022 321 826',
- ),
+ '2' => array(
+ 'location_type_id' => '1',
+ 'is_primary' => 1,
+ 'phone_type_id' => '1',
+ 'phone' => '022 321 826',
),
+ ),
'address' => array(
- '1' => array(
- 'location_type_id' => '1',
- 'is_primary' => 1,
- 'country_id' => '1013',
- 'state_province_id' => '1000',
- ),
+ '1' => array(
+ 'location_type_id' => '1',
+ 'is_primary' => 1,
+ 'country_id' => '1013',
+ 'state_province_id' => '1000',
),
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testProfileApply and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testProfileApply
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ProfileTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using profile get API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function profile_get_example(){
-$params = array(
- 'profile_id' => array(
+
+/**
+ * Test Generated example of using profile get API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function profile_get_example() {
+ $params = array(
+ 'profile_id' => array(
'0' => 15,
'1' => 1,
'2' => 'Billing',
),
- 'contact_id' => 3,
-);
+ 'contact_id' => 3,
+ );
-try{
- $result = civicrm_api3('profile', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+ try{
+ $result = civicrm_api3('profile', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
-return $result;
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function profile_get_expectedresult(){
+function profile_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 3,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 3,
+ 'values' => array(
'15' => array(
- 'postal_code-1' => '90210',
- 'state_province-1' => '1021',
- 'country-1' => '1228',
- 'phone-1-1' => '021 512 755',
- 'email-Primary' => 'abc1.xyz1@yahoo.com',
- 'last_name' => 'xyz1',
- 'first_name' => 'abc1',
- 'email-primary' => 'abc1.xyz1@yahoo.com',
- ),
+ 'postal_code-1' => '90210',
+ 'state_province-1' => '1021',
+ 'country-1' => '1228',
+ 'phone-1-1' => '021 512 755',
+ 'email-Primary' => 'abc1.xyz1@yahoo.com',
+ 'last_name' => 'xyz1',
+ 'first_name' => 'abc1',
+ 'email-primary' => 'abc1.xyz1@yahoo.com',
+ ),
'1' => array(
- 'first_name' => 'abc1',
- 'last_name' => 'xyz1',
- 'street_address-1' => '5 Saint Helier St',
- 'city-1' => 'Gotham City',
- 'postal_code-1' => '90210',
- 'country-1' => '1228',
- 'state_province-1' => '1021',
- ),
+ 'first_name' => 'abc1',
+ 'last_name' => 'xyz1',
+ 'street_address-1' => '5 Saint Helier St',
+ 'city-1' => 'Gotham City',
+ 'postal_code-1' => '90210',
+ 'country-1' => '1228',
+ 'state_province-1' => '1021',
+ ),
'Billing' => array(
- 'billing_first_name' => 'abc1',
- 'billing_middle_name' => 'J.',
- 'billing_last_name' => 'xyz1',
- 'billing_street_address-5' => '5 Saint Helier St',
- 'billing_city-5' => 'Gotham City',
- 'billing_state_province_id-5' => '1021',
- 'billing_country_id-5' => '1228',
- 'billing_postal_code-5' => '90210',
- 'billing-email-5' => 'abc1.xyz1@yahoo.com',
- 'email-5' => 'abc1.xyz1@yahoo.com',
- ),
+ 'billing_first_name' => 'abc1',
+ 'billing_middle_name' => 'J.',
+ 'billing_last_name' => 'xyz1',
+ 'billing_street_address-5' => '5 Saint Helier St',
+ 'billing_city-5' => 'Gotham City',
+ 'billing_state_province_id-5' => '1021',
+ 'billing_country_id-5' => '1228',
+ 'billing_postal_code-5' => '90210',
+ 'billing-email-5' => 'abc1.xyz1@yahoo.com',
+ 'email-5' => 'abc1.xyz1@yahoo.com',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testProfileGetMultiple and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testProfileGetMultiple
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ProfileTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using profile getfields API
- * demonstrates retrieving profile fields passing in an id *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function profile_getfields_example(){
-$params = array(
- 'action' => 'submit',
- 'profile_id' => 27,
-);
-try{
- $result = civicrm_api3('profile', 'getfields', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using profile getfields API.
+ *
+ * demonstrates retrieving profile fields passing in an id
+ *
+ * @return array
+ * API result array
+ */
+function profile_getfields_example() {
+ $params = array(
+ 'action' => 'submit',
+ 'profile_id' => 27,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('profile', 'getfields', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function profile_getfields_expectedresult(){
+function profile_getfields_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 9,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 9,
+ 'values' => array(
'custom_1' => array(
- 'label' => '_addCustomFieldToProfile',
- 'groupTitle' => '_addCustomFie',
- 'data_type' => 'String',
- 'html_type' => 'Text',
- 'default_value' => 'defaultValue',
- 'text_length' => '',
- 'options_per_line' => '',
- 'custom_group_id' => '1',
- 'extends' => 'Contact',
- 'is_search_range' => 0,
- 'extends_entity_column_value' => '',
- 'extends_entity_column_id' => '',
- 'is_view' => 0,
- 'is_multiple' => 0,
- 'option_group_id' => '',
- 'date_format' => '',
- 'time_format' => '',
- 'is_required' => 0,
- 'name' => 'custom_1',
- 'title' => 'first_name',
- 'type' => 2,
- 'api.required' => '1',
- 'help_pre' => '',
- 'help_post' => '',
- 'entity' => 'contact',
- 'weight' => '1',
- 'api.aliases' => array(),
- ),
+ 'label' => '_addCustomFieldToProfile',
+ 'groupTitle' => '_addCustomFie',
+ 'data_type' => 'String',
+ 'html_type' => 'Text',
+ 'default_value' => 'defaultValue',
+ 'text_length' => '',
+ 'options_per_line' => '',
+ 'custom_group_id' => '1',
+ 'extends' => 'Contact',
+ 'is_search_range' => 0,
+ 'extends_entity_column_value' => '',
+ 'extends_entity_column_id' => '',
+ 'is_view' => 0,
+ 'is_multiple' => 0,
+ 'option_group_id' => '',
+ 'date_format' => '',
+ 'time_format' => '',
+ 'is_required' => 0,
+ 'name' => 'custom_1',
+ 'title' => 'first_name',
+ 'type' => 2,
+ 'api.required' => '1',
+ 'help_pre' => '',
+ 'help_post' => '',
+ 'entity' => 'contact',
+ 'weight' => '1',
+ 'api.aliases' => array(),
+ ),
'postal_code-1' => array(
- 'name' => 'postal_code',
- 'type' => 2,
- 'title' => 'State Province',
- 'maxlength' => 12,
- 'size' => 12,
- 'import' => true,
- 'where' => 'civicrm_address.postal_code',
- 'headerPattern' => '/postal|zip/i',
- 'dataPattern' => '/\\d?\\d{4}(-\\d{4})?/',
- 'export' => true,
- 'api.required' => 0,
- 'help_pre' => '',
- 'help_post' => '',
- 'entity' => 'address',
- 'weight' => '2',
- 'api.aliases' => array(),
- ),
+ 'name' => 'postal_code',
+ 'type' => 2,
+ 'title' => 'State Province',
+ 'maxlength' => 12,
+ 'size' => 12,
+ 'import' => TRUE,
+ 'where' => 'civicrm_address.postal_code',
+ 'headerPattern' => '/postal|zip/i',
+ 'dataPattern' => '/\\d?\\d{4}(-\\d{4})?/',
+ 'export' => TRUE,
+ 'api.required' => 0,
+ 'help_pre' => '',
+ 'help_post' => '',
+ 'entity' => 'address',
+ 'weight' => '2',
+ 'api.aliases' => array(),
+ ),
'state_province-1' => array(
- 'name' => 'state_province_id',
- 'type' => 1,
- 'title' => 'State Province',
- 'FKClassName' => 'CRM_Core_DAO_StateProvince',
- 'html' => array(
- 'type' => 'Select',
- ),
- 'pseudoconstant' => array(
- 'table' => 'civicrm_state_province',
- 'keyColumn' => 'id',
- 'labelColumn' => 'name',
- ),
- 'api.required' => '1',
- 'help_pre' => '',
- 'help_post' => '',
- 'entity' => 'address',
- 'weight' => '3',
- 'api.aliases' => array(),
+ 'name' => 'state_province_id',
+ 'type' => 1,
+ 'title' => 'State Province',
+ 'FKClassName' => 'CRM_Core_DAO_StateProvince',
+ 'html' => array(
+ 'type' => 'Select',
+ ),
+ 'pseudoconstant' => array(
+ 'table' => 'civicrm_state_province',
+ 'keyColumn' => 'id',
+ 'labelColumn' => 'name',
),
+ 'FKApiName' => 'StateProvince',
+ 'api.required' => '1',
+ 'help_pre' => '',
+ 'help_post' => '',
+ 'entity' => 'address',
+ 'weight' => '3',
+ 'api.aliases' => array(),
+ ),
'country-1' => array(
- 'name' => 'country_id',
- 'type' => 1,
- 'title' => 'Country',
- 'FKClassName' => 'CRM_Core_DAO_Country',
- 'html' => array(
- 'type' => 'Select',
- ),
- 'pseudoconstant' => array(
- 'table' => 'civicrm_country',
- 'keyColumn' => 'id',
- 'labelColumn' => 'name',
- 'nameColumn' => 'iso_code',
- ),
- 'api.required' => '1',
- 'help_pre' => '',
- 'help_post' => '',
- 'entity' => 'address',
- 'weight' => '4',
- 'api.aliases' => array(),
+ 'name' => 'country_id',
+ 'type' => 1,
+ 'title' => 'Country',
+ 'FKClassName' => 'CRM_Core_DAO_Country',
+ 'html' => array(
+ 'type' => 'Select',
),
- 'phone-1-1' => array(
- 'name' => 'phone',
- 'type' => 2,
- 'title' => 'Phone',
- 'maxlength' => 32,
- 'size' => 20,
- 'import' => true,
- 'where' => 'civicrm_phone.phone',
- 'headerPattern' => '/phone/i',
- 'dataPattern' => '/^[\\d\\(\\)\\-\\.\\s]+$/',
- 'export' => true,
- 'api.required' => '1',
- 'help_pre' => '',
- 'help_post' => '',
- 'entity' => 'phone',
- 'weight' => '5',
- 'api.aliases' => array(),
+ 'pseudoconstant' => array(
+ 'table' => 'civicrm_country',
+ 'keyColumn' => 'id',
+ 'labelColumn' => 'name',
+ 'nameColumn' => 'iso_code',
),
+ 'FKApiName' => 'Country',
+ 'api.required' => '1',
+ 'help_pre' => '',
+ 'help_post' => '',
+ 'entity' => 'address',
+ 'weight' => '4',
+ 'api.aliases' => array(),
+ ),
+ 'phone-1-1' => array(
+ 'name' => 'phone',
+ 'type' => 2,
+ 'title' => 'Phone',
+ 'maxlength' => 32,
+ 'size' => 20,
+ 'import' => TRUE,
+ 'where' => 'civicrm_phone.phone',
+ 'headerPattern' => '/phone/i',
+ 'dataPattern' => '/^[\\d\\(\\)\\-\\.\\s]+$/',
+ 'export' => TRUE,
+ 'api.required' => '1',
+ 'help_pre' => '',
+ 'help_post' => '',
+ 'entity' => 'phone',
+ 'weight' => '5',
+ 'api.aliases' => array(),
+ ),
'email-primary' => array(
- 'name' => 'email',
- 'type' => 2,
- 'title' => 'Email',
- 'maxlength' => 254,
- 'size' => 20,
- 'import' => true,
- 'where' => 'civicrm_email.email',
- 'headerPattern' => '/e.?mail/i',
- 'dataPattern' => '/^[a-zA-Z][\\w\\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\\w\\.-]*[a-zA-Z0-9]\\.[a-zA-Z][a-zA-Z\\.]*[a-zA-Z]$/',
- 'export' => true,
- 'rule' => 'email',
- 'html' => array(
- 'type' => 'Text',
- ),
- 'api.required' => '1',
- 'help_pre' => '',
- 'help_post' => '',
- 'entity' => 'email',
- 'weight' => '6',
- 'api.aliases' => array(
- '0' => 'email-Primary',
- ),
+ 'name' => 'email',
+ 'type' => 2,
+ 'title' => 'Email',
+ 'maxlength' => 254,
+ 'size' => 20,
+ 'import' => TRUE,
+ 'where' => 'civicrm_email.email',
+ 'headerPattern' => '/e.?mail/i',
+ 'dataPattern' => '/^[a-zA-Z][\\w\\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\\w\\.-]*[a-zA-Z0-9]\\.[a-zA-Z][a-zA-Z\\.]*[a-zA-Z]$/',
+ 'export' => TRUE,
+ 'rule' => 'email',
+ 'html' => array(
+ 'type' => 'Text',
),
+ 'api.required' => '1',
+ 'help_pre' => '',
+ 'help_post' => '',
+ 'entity' => 'email',
+ 'weight' => '6',
+ 'api.aliases' => array(
+ '0' => 'email-Primary',
+ ),
+ ),
'last_name' => array(
- 'name' => 'last_name',
- 'type' => 2,
- 'title' => 'Last Name',
- 'maxlength' => 64,
- 'size' => 30,
- 'import' => true,
- 'where' => 'civicrm_contact.last_name',
- 'headerPattern' => '/^last|(l(ast\\s)?name)$/i',
- 'dataPattern' => '/^\\w+(\\s\\w+)?+$/',
- 'export' => true,
- 'html' => array(
- 'type' => 'Text',
- ),
- 'api.required' => '1',
- 'help_pre' => '',
- 'help_post' => '',
- 'entity' => 'contact',
- 'weight' => '7',
- 'api.aliases' => array(),
+ 'name' => 'last_name',
+ 'type' => 2,
+ 'title' => 'Last Name',
+ 'maxlength' => 64,
+ 'size' => 30,
+ 'import' => TRUE,
+ 'where' => 'civicrm_contact.last_name',
+ 'headerPattern' => '/^last|(l(ast\\s)?name)$/i',
+ 'dataPattern' => '/^\\w+(\\s\\w+)?+$/',
+ 'export' => TRUE,
+ 'html' => array(
+ 'type' => 'Text',
),
+ 'api.required' => '1',
+ 'help_pre' => '',
+ 'help_post' => '',
+ 'entity' => 'contact',
+ 'weight' => '7',
+ 'api.aliases' => array(),
+ ),
'first_name' => array(
- 'name' => 'first_name',
- 'type' => 2,
- 'title' => 'First Name',
- 'maxlength' => 64,
- 'size' => 30,
- 'import' => true,
- 'where' => 'civicrm_contact.first_name',
- 'headerPattern' => '/^first|(f(irst\\s)?name)$/i',
- 'dataPattern' => '/^\\w+$/',
- 'export' => true,
- 'html' => array(
- 'type' => 'Text',
- ),
- 'api.required' => '1',
- 'help_pre' => '',
- 'help_post' => '',
- 'entity' => 'contact',
- 'weight' => '8',
- 'api.aliases' => array(),
+ 'name' => 'first_name',
+ 'type' => 2,
+ 'title' => 'First Name',
+ 'maxlength' => 64,
+ 'size' => 30,
+ 'import' => TRUE,
+ 'where' => 'civicrm_contact.first_name',
+ 'headerPattern' => '/^first|(f(irst\\s)?name)$/i',
+ 'dataPattern' => '/^\\w+$/',
+ 'export' => TRUE,
+ 'html' => array(
+ 'type' => 'Text',
),
+ 'api.required' => '1',
+ 'help_pre' => '',
+ 'help_post' => '',
+ 'entity' => 'contact',
+ 'weight' => '8',
+ 'api.aliases' => array(),
+ ),
'profile_id' => array(
- 'api.required' => true,
- 'title' => 'Profile ID',
- ),
+ 'api.required' => TRUE,
+ 'title' => 'Profile ID',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetFields and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetFields
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ProfileTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using profile submit API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function profile_submit_example(){
-$params = array(
- 'profile_id' => 29,
- 'contact_id' => 3,
- 'first_name' => 'abc2',
- 'last_name' => 'xyz2',
- 'email-primary' => 'abc2.xyz2@gmail.com',
- 'phone-1-1' => '022 321 826',
- 'country-1' => '1013',
- 'state_province-1' => '1000',
-);
-try{
- $result = civicrm_api3('profile', 'submit', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using profile submit API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function profile_submit_example() {
+ $params = array(
+ 'profile_id' => 29,
+ 'contact_id' => 3,
+ 'first_name' => 'abc2',
+ 'last_name' => 'xyz2',
+ 'email-primary' => 'abc2.xyz2@gmail.com',
+ 'phone-1-1' => '022 321 826',
+ 'country-1' => '1013',
+ 'state_province-1' => '1000',
+ );
-return $result;
+ try{
+ $result = civicrm_api3('profile', 'submit', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function profile_submit_expectedresult(){
+function profile_submit_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 3,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 3,
+ 'values' => array(
'3' => array(
- 'id' => '3',
- 'contact_type' => 'Individual',
- 'contact_sub_type' => '',
- 'do_not_email' => 0,
- 'do_not_phone' => 0,
- 'do_not_mail' => 0,
- 'do_not_sms' => 0,
- 'do_not_trade' => 0,
- 'is_opt_out' => 0,
- 'legal_identifier' => '',
- 'external_identifier' => '',
- 'sort_name' => 'xyz2, abc2',
- 'display_name' => 'Mr. abc2 xyz2 II',
- 'nick_name' => '',
- 'legal_name' => '',
- 'image_URL' => '',
- 'preferred_communication_method' => '',
- 'preferred_language' => 'en_US',
- 'preferred_mail_format' => 'Both',
- 'hash' => '67eac7789eaee00',
- 'api_key' => '',
- 'first_name' => 'abc2',
- 'middle_name' => 'J.',
- 'last_name' => 'xyz2',
- 'prefix_id' => '3',
- 'suffix_id' => '3',
- 'formal_title' => '',
- 'communication_style_id' => '',
- 'email_greeting_id' => '1',
- 'email_greeting_custom' => '',
- 'email_greeting_display' => 'Dear abc1',
- 'postal_greeting_id' => '1',
- 'postal_greeting_custom' => '',
- 'postal_greeting_display' => 'Dear abc1',
- 'addressee_id' => '1',
- 'addressee_custom' => '',
- 'addressee_display' => 'Mr. abc1 J. xyz1 II',
- 'job_title' => '',
- 'gender_id' => '',
- 'birth_date' => '',
- 'is_deceased' => 0,
- 'deceased_date' => '',
- 'household_name' => '',
- 'primary_contact_id' => '',
- 'organization_name' => '',
- 'sic_code' => '',
- 'user_unique_id' => '',
- 'created_date' => '2013-07-28 08:49:19',
- 'modified_date' => '2012-11-14 16:02:35',
- ),
+ 'id' => '3',
+ 'contact_type' => 'Individual',
+ 'contact_sub_type' => '',
+ 'do_not_email' => 0,
+ 'do_not_phone' => 0,
+ 'do_not_mail' => 0,
+ 'do_not_sms' => 0,
+ 'do_not_trade' => 0,
+ 'is_opt_out' => 0,
+ 'legal_identifier' => '',
+ 'external_identifier' => '',
+ 'sort_name' => 'xyz2, abc2',
+ 'display_name' => 'Mr. abc2 xyz2 II',
+ 'nick_name' => '',
+ 'legal_name' => '',
+ 'image_URL' => '',
+ 'preferred_communication_method' => '',
+ 'preferred_language' => 'en_US',
+ 'preferred_mail_format' => 'Both',
+ 'hash' => '67eac7789eaee00',
+ 'api_key' => '',
+ 'first_name' => 'abc2',
+ 'middle_name' => 'J.',
+ 'last_name' => 'xyz2',
+ 'prefix_id' => '3',
+ 'suffix_id' => '3',
+ 'formal_title' => '',
+ 'communication_style_id' => '',
+ 'email_greeting_id' => '1',
+ 'email_greeting_custom' => '',
+ 'email_greeting_display' => 'Dear abc1',
+ 'postal_greeting_id' => '1',
+ 'postal_greeting_custom' => '',
+ 'postal_greeting_display' => 'Dear abc1',
+ 'addressee_id' => '1',
+ 'addressee_custom' => '',
+ 'addressee_display' => 'Mr. abc1 J. xyz1 II',
+ 'job_title' => '',
+ 'gender_id' => '',
+ 'birth_date' => '',
+ 'is_deceased' => 0,
+ 'deceased_date' => '',
+ 'household_name' => '',
+ 'primary_contact_id' => '',
+ 'organization_name' => '',
+ 'sic_code' => '',
+ 'user_unique_id' => '',
+ 'created_date' => '2013-07-28 08:49:19',
+ 'modified_date' => '2012-11-14 16:02:35',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testProfileSubmit and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testProfileSubmit
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ProfileTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using relationship get API
- * demonstrates use of BETWEEN filter *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function relationship_get_example(){
-$params = array(
- 'relationship_type_id' => array(
+
+/**
+ * Test Generated example of using relationship get API.
+ *
+ * demonstrates use of BETWEEN filter
+ *
+ * @return array
+ * API result array
+ */
+function relationship_get_example() {
+ $params = array(
+ 'relationship_type_id' => array(
'BETWEEN' => array(
- '0' => 33,
- '1' => 35,
- ),
+ '0' => 33,
+ '1' => 35,
+ ),
),
-);
+ );
-try{
- $result = civicrm_api3('relationship', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+ try{
+ $result = civicrm_api3('relationship', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
-return $result;
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function relationship_get_expectedresult(){
+function relationship_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 3,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 3,
+ 'values' => array(
'2' => array(
- 'id' => '2',
- 'contact_id_a' => '87',
- 'contact_id_b' => '89',
- 'relationship_type_id' => '33',
- 'start_date' => '2013-07-29 00:00:00',
- 'is_active' => '1',
- 'description' => '',
- 'is_permission_a_b' => 0,
- 'is_permission_b_a' => 0,
- ),
+ 'id' => '2',
+ 'contact_id_a' => '87',
+ 'contact_id_b' => '89',
+ 'relationship_type_id' => '33',
+ 'start_date' => '2013-07-29 00:00:00',
+ 'is_active' => '1',
+ 'description' => '',
+ 'is_permission_a_b' => 0,
+ 'is_permission_b_a' => 0,
+ ),
'3' => array(
- 'id' => '3',
- 'contact_id_a' => '87',
- 'contact_id_b' => '89',
- 'relationship_type_id' => '34',
- 'start_date' => '2013-07-29 00:00:00',
- 'is_active' => '1',
- 'description' => '',
- 'is_permission_a_b' => 0,
- 'is_permission_b_a' => 0,
- ),
+ 'id' => '3',
+ 'contact_id_a' => '87',
+ 'contact_id_b' => '89',
+ 'relationship_type_id' => '34',
+ 'start_date' => '2013-07-29 00:00:00',
+ 'is_active' => '1',
+ 'description' => '',
+ 'is_permission_a_b' => 0,
+ 'is_permission_b_a' => 0,
+ ),
'4' => array(
- 'id' => '4',
- 'contact_id_a' => '87',
- 'contact_id_b' => '89',
- 'relationship_type_id' => '35',
- 'start_date' => '2013-07-29 00:00:00',
- 'is_active' => '1',
- 'description' => '',
- 'is_permission_a_b' => 0,
- 'is_permission_b_a' => 0,
- ),
+ 'id' => '4',
+ 'contact_id_a' => '87',
+ 'contact_id_b' => '89',
+ 'relationship_type_id' => '35',
+ 'start_date' => '2013-07-29 00:00:00',
+ 'is_active' => '1',
+ 'description' => '',
+ 'is_permission_a_b' => 0,
+ 'is_permission_b_a' => 0,
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetTypeOperators and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetTypeOperators
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/RelationshipTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using relationship create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function relationship_create_example(){
-$params = array(
- 'contact_id_a' => 31,
- 'contact_id_b' => 33,
- 'relationship_type_id' => 18,
- 'start_date' => '2010-10-30',
- 'end_date' => '2010-12-30',
- 'is_active' => 1,
- 'note' => 'note',
-);
-try{
- $result = civicrm_api3('relationship', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using relationship create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function relationship_create_example() {
+ $params = array(
+ 'contact_id_a' => 31,
+ 'contact_id_b' => 33,
+ 'relationship_type_id' => 18,
+ 'start_date' => '2010-10-30',
+ 'end_date' => '2010-12-30',
+ 'is_active' => 1,
+ 'note' => 'note',
+ );
-return $result;
+ try{
+ $result = civicrm_api3('relationship', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function relationship_create_expectedresult(){
+function relationship_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'contact_id_a' => '31',
- 'contact_id_b' => '33',
- 'relationship_type_id' => '18',
- 'start_date' => '2013-07-29 00:00:00',
- 'end_date' => '2013-08-04 00:00:00',
- 'is_active' => '1',
- 'description' => '',
- 'is_permission_a_b' => 0,
- 'is_permission_b_a' => 0,
- 'case_id' => '',
- ),
+ 'id' => '1',
+ 'contact_id_a' => '31',
+ 'contact_id_b' => '33',
+ 'relationship_type_id' => '18',
+ 'start_date' => '2013-07-29 00:00:00',
+ 'end_date' => '2013-08-04 00:00:00',
+ 'is_active' => '1',
+ 'description' => '',
+ 'is_permission_a_b' => 0,
+ 'is_permission_b_a' => 0,
+ 'case_id' => '',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testRelationshipCreate and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testRelationshipCreate
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/RelationshipTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using relationship delete API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function relationship_delete_example(){
-$params = array(
- 'id' => 1,
-);
-try{
- $result = civicrm_api3('relationship', 'delete', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using relationship delete API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function relationship_delete_example() {
+ $params = array(
+ 'id' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('relationship', 'delete', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function relationship_delete_expectedresult(){
+function relationship_delete_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'values' => 'Deleted relationship successfully',
-);
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'values' => 'Deleted relationship successfully',
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testRelationshipDelete and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testRelationshipDelete
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/RelationshipTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using relationship get API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function relationship_get_example(){
-$params = array(
- 'id' => 1,
-);
-try{
- $result = civicrm_api3('relationship', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using relationship get API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function relationship_get_example() {
+ $params = array(
+ 'id' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('relationship', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function relationship_get_expectedresult(){
+function relationship_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'contact_id_a' => '47',
- 'contact_id_b' => '49',
- 'relationship_type_id' => '22',
- 'start_date' => '2013-07-29 00:00:00',
- 'is_active' => '1',
- 'description' => '',
- 'is_permission_a_b' => 0,
- 'is_permission_b_a' => 0,
- 'custom_1' => 'custom string',
- 'custom_1_1' => 'custom string',
- ),
+ 'id' => '1',
+ 'contact_id_a' => '47',
+ 'contact_id_b' => '49',
+ 'relationship_type_id' => '22',
+ 'start_date' => '2013-07-29 00:00:00',
+ 'is_active' => '1',
+ 'description' => '',
+ 'is_permission_a_b' => 0,
+ 'is_permission_b_a' => 0,
+ 'custom_1' => 'custom string',
+ 'custom_1_1' => 'custom string',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetWithCustom and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetWithCustom
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/RelationshipTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using relationship get API
- * demonstrates use of IN filter *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function relationship_get_example(){
-$params = array(
- 'relationship_type_id' => array(
+
+/**
+ * Test Generated example of using relationship get API.
+ *
+ * demonstrates use of IN filter
+ *
+ * @return array
+ * API result array
+ */
+function relationship_get_example() {
+ $params = array(
+ 'relationship_type_id' => array(
'IN' => array(
- '0' => 33,
- '1' => 34,
- ),
+ '0' => 33,
+ '1' => 34,
+ ),
),
-);
+ );
-try{
- $result = civicrm_api3('relationship', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+ try{
+ $result = civicrm_api3('relationship', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
-return $result;
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function relationship_get_expectedresult(){
+function relationship_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 2,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 2,
+ 'values' => array(
'2' => array(
- 'id' => '2',
- 'contact_id_a' => '87',
- 'contact_id_b' => '89',
- 'relationship_type_id' => '33',
- 'start_date' => '2013-07-29 00:00:00',
- 'is_active' => '1',
- 'description' => '',
- 'is_permission_a_b' => 0,
- 'is_permission_b_a' => 0,
- ),
+ 'id' => '2',
+ 'contact_id_a' => '87',
+ 'contact_id_b' => '89',
+ 'relationship_type_id' => '33',
+ 'start_date' => '2013-07-29 00:00:00',
+ 'is_active' => '1',
+ 'description' => '',
+ 'is_permission_a_b' => 0,
+ 'is_permission_b_a' => 0,
+ ),
'3' => array(
- 'id' => '3',
- 'contact_id_a' => '87',
- 'contact_id_b' => '89',
- 'relationship_type_id' => '34',
- 'start_date' => '2013-07-29 00:00:00',
- 'is_active' => '1',
- 'description' => '',
- 'is_permission_a_b' => 0,
- 'is_permission_b_a' => 0,
- ),
+ 'id' => '3',
+ 'contact_id_a' => '87',
+ 'contact_id_b' => '89',
+ 'relationship_type_id' => '34',
+ 'start_date' => '2013-07-29 00:00:00',
+ 'is_active' => '1',
+ 'description' => '',
+ 'is_permission_a_b' => 0,
+ 'is_permission_b_a' => 0,
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetTypeOperators and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetTypeOperators
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/RelationshipTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using relationship get API
- * demonstrates use of Not BETWEEN filter *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function relationship_get_example(){
-$params = array(
- 'relationship_type_id' => array(
+
+/**
+ * Test Generated example of using relationship get API.
+ *
+ * demonstrates use of Not BETWEEN filter
+ *
+ * @return array
+ * API result array
+ */
+function relationship_get_example() {
+ $params = array(
+ 'relationship_type_id' => array(
'NOT BETWEEN' => array(
- '0' => 33,
- '1' => 35,
- ),
+ '0' => 33,
+ '1' => 35,
+ ),
),
-);
+ );
-try{
- $result = civicrm_api3('relationship', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+ try{
+ $result = civicrm_api3('relationship', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
-return $result;
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function relationship_get_expectedresult(){
+function relationship_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'contact_id_a' => '87',
- 'contact_id_b' => '89',
- 'relationship_type_id' => '32',
- 'start_date' => '2013-07-29 00:00:00',
- 'is_active' => '1',
- 'description' => '',
- 'is_permission_a_b' => 0,
- 'is_permission_b_a' => 0,
- ),
+ 'id' => '1',
+ 'contact_id_a' => '87',
+ 'contact_id_b' => '89',
+ 'relationship_type_id' => '32',
+ 'start_date' => '2013-07-29 00:00:00',
+ 'is_active' => '1',
+ 'description' => '',
+ 'is_permission_a_b' => 0,
+ 'is_permission_b_a' => 0,
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetTypeOperators and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetTypeOperators
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/RelationshipTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using relationship get API
- * demonstrates use of NOT IN filter *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function relationship_get_example(){
-$params = array(
- 'relationship_type_id' => array(
+
+/**
+ * Test Generated example of using relationship get API.
+ *
+ * demonstrates use of NOT IN filter
+ *
+ * @return array
+ * API result array
+ */
+function relationship_get_example() {
+ $params = array(
+ 'relationship_type_id' => array(
'NOT IN' => array(
- '0' => 33,
- '1' => 34,
- ),
+ '0' => 33,
+ '1' => 34,
+ ),
),
-);
+ );
-try{
- $result = civicrm_api3('relationship', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+ try{
+ $result = civicrm_api3('relationship', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
-return $result;
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function relationship_get_expectedresult(){
+function relationship_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 2,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 2,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'contact_id_a' => '87',
- 'contact_id_b' => '89',
- 'relationship_type_id' => '32',
- 'start_date' => '2013-07-29 00:00:00',
- 'is_active' => '1',
- 'description' => '',
- 'is_permission_a_b' => 0,
- 'is_permission_b_a' => 0,
- ),
+ 'id' => '1',
+ 'contact_id_a' => '87',
+ 'contact_id_b' => '89',
+ 'relationship_type_id' => '32',
+ 'start_date' => '2013-07-29 00:00:00',
+ 'is_active' => '1',
+ 'description' => '',
+ 'is_permission_a_b' => 0,
+ 'is_permission_b_a' => 0,
+ ),
'4' => array(
- 'id' => '4',
- 'contact_id_a' => '87',
- 'contact_id_b' => '89',
- 'relationship_type_id' => '35',
- 'start_date' => '2013-07-29 00:00:00',
- 'is_active' => '1',
- 'description' => '',
- 'is_permission_a_b' => 0,
- 'is_permission_b_a' => 0,
- ),
+ 'id' => '4',
+ 'contact_id_a' => '87',
+ 'contact_id_b' => '89',
+ 'relationship_type_id' => '35',
+ 'start_date' => '2013-07-29 00:00:00',
+ 'is_active' => '1',
+ 'description' => '',
+ 'is_permission_a_b' => 0,
+ 'is_permission_b_a' => 0,
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetTypeOperators and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetTypeOperators
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/RelationshipTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using relationship get API
- * demonstrates is_current filter *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function relationship_get_example(){
-$params = array(
- 'filters' => array(
+
+/**
+ * Test Generated example of using relationship get API.
+ *
+ * demonstrates is_current filter
+ *
+ * @return array
+ * API result array
+ */
+function relationship_get_example() {
+ $params = array(
+ 'filters' => array(
'is_current' => 1,
),
-);
+ );
-try{
- $result = civicrm_api3('relationship', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+ try{
+ $result = civicrm_api3('relationship', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
-return $result;
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function relationship_get_expectedresult(){
+function relationship_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 2,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 2,
+ 'values' => array(
'2' => array(
- 'id' => '2',
- 'contact_id_a' => '83',
- 'contact_id_b' => '85',
- 'relationship_type_id' => '31',
- 'start_date' => '2013-07-29 00:00:00',
- 'is_active' => '1',
- 'description' => '',
- 'is_permission_a_b' => 0,
- 'is_permission_b_a' => 0,
- ),
+ 'id' => '2',
+ 'contact_id_a' => '83',
+ 'contact_id_b' => '85',
+ 'relationship_type_id' => '31',
+ 'start_date' => '2013-07-29 00:00:00',
+ 'is_active' => '1',
+ 'description' => '',
+ 'is_permission_a_b' => 0,
+ 'is_permission_b_a' => 0,
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetIsCurrent and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetIsCurrent
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/RelationshipTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using relationship_type create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function relationship_type_create_example(){
-$params = array(
- 'name_a_b' => 'Relation 1 for relationship type create',
- 'name_b_a' => 'Relation 2 for relationship type create',
- 'contact_type_a' => 'Individual',
- 'contact_type_b' => 'Organization',
- 'is_reserved' => 1,
- 'is_active' => 1,
- 'sequential' => 1,
-);
-try{
- $result = civicrm_api3('relationship_type', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using relationship_type create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function relationship_type_create_example() {
+ $params = array(
+ 'name_a_b' => 'Relation 1 for relationship type create',
+ 'name_b_a' => 'Relation 2 for relationship type create',
+ 'contact_type_a' => 'Individual',
+ 'contact_type_b' => 'Organization',
+ 'is_reserved' => 1,
+ 'is_active' => 1,
+ 'sequential' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('relationship_type', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function relationship_type_create_expectedresult(){
+function relationship_type_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'0' => array(
- 'id' => '1',
- 'name_a_b' => 'Relation 1 for relationship type create',
- 'label_a_b' => 'Relation 1 for relationship type create',
- 'name_b_a' => 'Relation 2 for relationship type create',
- 'label_b_a' => 'Relation 2 for relationship type create',
- 'description' => '',
- 'contact_type_a' => 'Individual',
- 'contact_type_b' => 'Organization',
- 'contact_sub_type_a' => '',
- 'contact_sub_type_b' => '',
- 'is_reserved' => '1',
- 'is_active' => '1',
- ),
+ 'id' => '1',
+ 'name_a_b' => 'Relation 1 for relationship type create',
+ 'label_a_b' => 'Relation 1 for relationship type create',
+ 'name_b_a' => 'Relation 2 for relationship type create',
+ 'label_b_a' => 'Relation 2 for relationship type create',
+ 'description' => '',
+ 'contact_type_a' => 'Individual',
+ 'contact_type_b' => 'Organization',
+ 'contact_sub_type_a' => '',
+ 'contact_sub_type_b' => '',
+ 'is_reserved' => '1',
+ 'is_active' => '1',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testRelationshipTypeCreate and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testRelationshipTypeCreate
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/RelationshipTypeTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using relationship_type delete API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function relationship_type_delete_example(){
-$params = array(
- 'id' => 1,
-);
-try{
- $result = civicrm_api3('relationship_type', 'delete', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using relationship_type delete API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function relationship_type_delete_example() {
+ $params = array(
+ 'id' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('relationship_type', 'delete', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function relationship_type_delete_expectedresult(){
+function relationship_type_delete_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'values' => true,
-);
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'values' => TRUE,
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testRelationshipTypeDelete and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testRelationshipTypeDelete
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/RelationshipTypeTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using report_template getrows API
- * Retrieve rows from a report template (optionally providing the instance_id) *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function report_template_getrows_example(){
-$params = array(
- 'report_id' => 'contact/summary',
- 'options' => array(
+
+/**
+ * Test Generated example of using report_template getrows API.
+ *
+ * Retrieve rows from a report template (optionally providing the instance_id)
+ *
+ * @return array
+ * API result array
+ */
+function report_template_getrows_example() {
+ $params = array(
+ 'report_id' => 'contact/summary',
+ 'options' => array(
'metadata' => array(
- '0' => 'labels',
- '1' => 'title',
- ),
+ '0' => 'labels',
+ '1' => 'title',
+ ),
),
-);
+ );
-try{
- $result = civicrm_api3('report_template', 'getrows', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+ try{
+ $result = civicrm_api3('report_template', 'getrows', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
-return $result;
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function report_template_getrows_expectedresult(){
+function report_template_getrows_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 2,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 2,
+ 'values' => array(
'0' => array(
- 'civicrm_contact_sort_name' => 'Default Organization',
- 'civicrm_contact_id' => '1',
- ),
+ 'civicrm_contact_sort_name' => 'Default Organization',
+ 'civicrm_contact_id' => '1',
+ ),
'1' => array(
- 'civicrm_contact_sort_name' => 'Second Domain',
- 'civicrm_contact_id' => '2',
- ),
+ 'civicrm_contact_sort_name' => 'Second Domain',
+ 'civicrm_contact_id' => '2',
+ ),
),
- 'metadata' => array(
+ 'metadata' => array(
'title' => 'ERROR: Title is not Set',
'labels' => array(
- 'civicrm_contact_sort_name' => 'Contact Name',
- 'civicrm_contact_id' => 'Internal Contact ID',
- ),
+ 'civicrm_contact_sort_name' => 'Contact Name',
+ 'civicrm_contact_id' => 'Internal Contact ID',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testReportTemplateGetRowsContactSummary and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testReportTemplateGetRowsContactSummary
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ReportTemplateTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using report_template getstatistics API
- * Get Statistics from a report (note there isn't much data to get in the test DB :-( *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function report_template_getstatistics_example(){
-$params = array(
- 'report_id' => 'member/contributionDetail',
-);
-try{
- $result = civicrm_api3('report_template', 'getstatistics', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using report_template getstatistics API.
+ *
+ * Get Statistics from a report (note there isn't much data to get in the test DB :-(
+ *
+ * @return array
+ * API result array
+ */
+function report_template_getstatistics_example() {
+ $params = array(
+ 'report_id' => 'contribute/recur',
+ );
-return $result;
+ try{
+ $result = civicrm_api3('report_template', 'getstatistics', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function report_template_getstatistics_expectedresult(){
+function report_template_getstatistics_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 2,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 2,
+ 'values' => array(
'counts' => array(
- 'rowCount' => array(
- 'title' => 'Row(s) Listed',
- 'value' => 0,
- ),
- 'amount' => array(
- 'title' => 'Total Amount',
- 'value' => '',
- 'type' => 2,
- ),
- 'avg' => array(
- 'title' => 'Average',
- 'value' => '',
- 'type' => 2,
- ),
+ 'rowCount' => array(
+ 'title' => 'Row(s) Listed',
+ 'value' => 0,
),
+ ),
'filters' => array(),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testReportTemplateGetStatisticsAllReports and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testReportTemplateGetStatisticsAllReports
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ReportTemplateTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using setting create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function setting_create_example(){
-$params = array(
- 'domain_id' => 2,
- 'uniq_email_per_site' => 1,
-);
-try{
- $result = civicrm_api3('setting', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using setting create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function setting_create_example() {
+ $params = array(
+ 'domain_id' => 2,
+ 'uniq_email_per_site' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('setting', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function setting_create_expectedresult(){
+function setting_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 2,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 2,
+ 'values' => array(
'2' => array(
- 'uniq_email_per_site' => '1',
- ),
+ 'uniq_email_per_site' => '1',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreateSetting and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreateSetting
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/SettingTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using setting create API
- * shows setting a variable for all domains *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function setting_create_example(){
-$params = array(
- 'domain_id' => 'all',
- 'uniq_email_per_site' => 1,
-);
-try{
- $result = civicrm_api3('setting', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using setting create API.
+ *
+ * shows setting a variable for all domains
+ *
+ * @return array
+ * API result array
+ */
+function setting_create_example() {
+ $params = array(
+ 'domain_id' => 'all',
+ 'uniq_email_per_site' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('setting', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function setting_create_expectedresult(){
+function setting_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 3,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 3,
+ 'values' => array(
'1' => array(
- 'uniq_email_per_site' => '1',
- ),
+ 'uniq_email_per_site' => '1',
+ ),
'2' => array(
- 'uniq_email_per_site' => '1',
- ),
+ 'uniq_email_per_site' => '1',
+ ),
'3' => array(
- 'uniq_email_per_site' => '1',
- ),
+ 'uniq_email_per_site' => '1',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreateSettingMultipleDomains and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreateSettingMultipleDomains
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/SettingTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using setting create API
- * shows setting a variable for a current domain *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function setting_create_example(){
-$params = array(
- 'uniq_email_per_site' => 1,
-);
-try{
- $result = civicrm_api3('setting', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using setting create API.
+ *
+ * shows setting a variable for a current domain
+ *
+ * @return array
+ * API result array
+ */
+function setting_create_example() {
+ $params = array(
+ 'uniq_email_per_site' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('setting', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function setting_create_expectedresult(){
+function setting_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'uniq_email_per_site' => '1',
- ),
+ 'uniq_email_per_site' => '1',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreateSetting and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreateSetting
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/SettingTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using setting create API
- * shows setting a variable for specified domains *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function setting_create_example(){
-$params = array(
- 'domain_id' => array(
+
+/**
+ * Test Generated example of using setting create API.
+ *
+ * shows setting a variable for specified domains
+ *
+ * @return array
+ * API result array
+ */
+function setting_create_example() {
+ $params = array(
+ 'domain_id' => array(
'0' => 1,
'1' => 3,
),
- 'uniq_email_per_site' => 0,
-);
+ 'uniq_email_per_site' => 0,
+ );
-try{
- $result = civicrm_api3('setting', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+ try{
+ $result = civicrm_api3('setting', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
-return $result;
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function setting_create_expectedresult(){
+function setting_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 2,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 2,
+ 'values' => array(
'1' => array(
- 'uniq_email_per_site' => 0,
- ),
+ 'uniq_email_per_site' => 0,
+ ),
'3' => array(
- 'uniq_email_per_site' => 0,
- ),
+ 'uniq_email_per_site' => 0,
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreateSettingMultipleDomains and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreateSettingMultipleDomains
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/SettingTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using setting get API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function setting_get_example(){
-$params = array(
- 'domain_id' => 2,
- 'return' => 'uniq_email_per_site',
-);
-try{
- $result = civicrm_api3('setting', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using setting get API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function setting_get_example() {
+ $params = array(
+ 'domain_id' => 2,
+ 'return' => 'uniq_email_per_site',
+ );
-return $result;
+ try{
+ $result = civicrm_api3('setting', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function setting_get_expectedresult(){
+function setting_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 2,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 2,
+ 'values' => array(
'2' => array(
- 'uniq_email_per_site' => '1',
- ),
+ 'uniq_email_per_site' => '1',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetSetting and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetSetting
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/SettingTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using setting Get API
- * shows getting a variable for all domains *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function setting_get_example(){
-$params = array(
- 'domain_id' => 'all',
- 'return' => 'uniq_email_per_site',
-);
-try{
- $result = civicrm_api3('setting', 'Get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using setting Get API.
+ *
+ * shows getting a variable for all domains
+ *
+ * @return array
+ * API result array
+ */
+function setting_get_example() {
+ $params = array(
+ 'domain_id' => 'all',
+ 'return' => 'uniq_email_per_site',
+ );
-return $result;
+ try{
+ $result = civicrm_api3('setting', 'Get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function setting_get_expectedresult(){
+function setting_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 3,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 3,
+ 'values' => array(
'1' => array(
- 'uniq_email_per_site' => '1',
- ),
+ 'uniq_email_per_site' => '1',
+ ),
'2' => array(
- 'uniq_email_per_site' => '1',
- ),
+ 'uniq_email_per_site' => '1',
+ ),
'3' => array(
- 'uniq_email_per_site' => '1',
- ),
+ 'uniq_email_per_site' => '1',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreateSettingMultipleDomains and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreateSettingMultipleDomains
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/SettingTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using setting getdefaults API
- * gets defaults setting a variable for a given domain - if no domain is set current is assumed *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function setting_getdefaults_example(){
-$params = array(
- 'name' => 'address_format',
-);
-try{
- $result = civicrm_api3('setting', 'getdefaults', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using setting getdefaults API.
+ *
+ * gets defaults setting a variable for a given domain - if no domain is set current is assumed
+ *
+ * @return array
+ * API result array
+ */
+function setting_getdefaults_example() {
+ $params = array(
+ 'name' => 'address_format',
+ );
-return $result;
+ try{
+ $result = civicrm_api3('setting', 'getdefaults', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function setting_getdefaults_expectedresult(){
+function setting_getdefaults_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'address_format' => '{contact.address_name}
+ 'address_format' => '{contact.address_name}
{contact.street_address}
{contact.supplemental_address_1}
{contact.supplemental_address_2}
{contact.city}{, }{contact.state_province}{ }{contact.postal_code}
{contact.country}',
- ),
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetDefaults and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetDefaults
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/SettingTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using setting getfields API
- * Demonstrate return from getfields - see subfolder for variants *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function setting_getfields_example(){
-$params = array();
-try{
- $result = civicrm_api3('setting', 'getfields', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using setting getfields API.
+ *
+ * Demonstrate return from getfields - see subfolder for variants
+ *
+ * @return array
+ * API result array
+ */
+function setting_getfields_example() {
+ $params = array();
-return $result;
+ try{
+ $result = civicrm_api3('setting', 'getfields', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function setting_getfields_expectedresult(){
+function setting_getfields_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 89,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 91,
+ 'values' => array(
'address_standardization_provider' => array(
- 'group_name' => 'Address Preferences',
- 'group' => 'address',
- 'name' => 'address_standardization_provider',
- 'type' => 'String',
- 'html_type' => 'Select',
- 'default' => '',
- 'add' => '4.1',
- 'title' => 'Address Standardization Provider.',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => '',
- 'help_text' => 'CiviCRM includes an optional plugin for interfacing with the United States Postal Services (USPS) Address Standardization web service. You must register to use the USPS service at https://www.usps.com/business/web-tools-apis/address-information.htm. If you are approved, they will provide you with a User ID and the URL for the service. Plugins for other address standardization services may be available from 3rd party developers. If installed, they will be included in the drop-down below. ',
- ),
+ 'group_name' => 'Address Preferences',
+ 'group' => 'address',
+ 'name' => 'address_standardization_provider',
+ 'type' => 'String',
+ 'html_type' => 'Select',
+ 'default' => '',
+ 'add' => '4.1',
+ 'title' => 'Address Standardization Provider.',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => 'CiviCRM includes an optional plugin for interfacing with the United States Postal Services (USPS) Address Standardization web service. You must register to use the USPS service at https://www.usps.com/business/web-tools-apis/address-information.htm. If you are approved, they will provide you with a User ID and the URL for the service. Plugins for other address standardization services may be available from 3rd party developers. If installed, they will be included in the drop-down below. ',
+ ),
'address_standardization_userid' => array(
- 'group_name' => 'Address Preferences',
- 'group' => 'address',
- 'name' => 'address_standardization_userid',
- 'type' => 'String',
- 'html_type' => 'Text',
- 'default' => '',
- 'add' => '4.1',
- 'title' => 'Web service user ID',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => '',
- 'help_text' => '',
- ),
+ 'group_name' => 'Address Preferences',
+ 'group' => 'address',
+ 'name' => 'address_standardization_userid',
+ 'type' => 'String',
+ 'html_type' => 'Text',
+ 'default' => '',
+ 'add' => '4.1',
+ 'title' => 'Web service user ID',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => '',
+ ),
'address_standardization_url' => array(
- 'group_name' => 'Address Preferences',
- 'group' => 'address',
- 'name' => 'address_standardization_url',
- 'type' => 'Text',
- 'html_type' => 'Text',
- 'default' => '',
- 'add' => '4.1',
- 'title' => 'Web Service URL',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => '',
- 'help_text' => 'Web Service URL',
- 'validate_callback' => 'CRM_Utils_Rule::url',
- ),
+ 'group_name' => 'Address Preferences',
+ 'group' => 'address',
+ 'name' => 'address_standardization_url',
+ 'type' => 'Text',
+ 'html_type' => 'Text',
+ 'default' => '',
+ 'add' => '4.1',
+ 'title' => 'Web Service URL',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => 'Web Service URL',
+ 'validate_callback' => 'CRM_Utils_Rule::url',
+ ),
'tag_unconfirmed' => array(
- 'group_name' => 'Campaign Preferences',
- 'group' => 'campaign',
- 'name' => 'tag_unconfirmed',
- 'type' => 'String',
- 'html_type' => 'Text',
- 'default' => 'Unconfirmed',
- 'add' => '4.1',
- 'title' => 'Tag for Unconfirmed Petition Signers',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => '',
- 'help_text' => 'If set, new contacts that are created when signing a petition are assigned a tag of this name.',
- ),
+ 'group_name' => 'Campaign Preferences',
+ 'group' => 'campaign',
+ 'name' => 'tag_unconfirmed',
+ 'type' => 'String',
+ 'html_type' => 'Text',
+ 'default' => 'Unconfirmed',
+ 'add' => '4.1',
+ 'title' => 'Tag for Unconfirmed Petition Signers',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => 'If set, new contacts that are created when signing a petition are assigned a tag of this name.',
+ ),
'petition_contacts' => array(
- 'group_name' => 'Campaign Preferences',
- 'group' => 'campaign',
- 'name' => 'petition_contacts',
- 'type' => 'String',
- 'html_type' => 'Text',
- 'default' => 'Petition Contacts',
- 'add' => '4.1',
- 'title' => 'Petition Signers Group',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => '',
- 'help_text' => 'If set, new contacts that are created when signing a petition are assigned a tag of this name.',
- ),
+ 'group_name' => 'Campaign Preferences',
+ 'group' => 'campaign',
+ 'name' => 'petition_contacts',
+ 'type' => 'String',
+ 'html_type' => 'Text',
+ 'default' => 'Petition Contacts',
+ 'add' => '4.1',
+ 'title' => 'Petition Signers Group',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => 'If set, new contacts that are created when signing a petition are assigned a tag of this name.',
+ ),
'cvv_backoffice_required' => array(
- 'group_name' => 'Contribute Preferences',
- 'group' => 'contribute',
- 'name' => 'cvv_backoffice_required',
- 'type' => 'Boolean',
- 'quick_form_type' => 'YesNo',
- 'default' => '1',
- 'add' => '4.1',
- 'title' => 'CVV required for backoffice?',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => 'Is the CVV code required for back office credit card transactions',
- 'help_text' => 'If set it back-office credit card transactions will required a cvv code. Leave as required unless you have a very strong reason to change',
- ),
+ 'group_name' => 'Contribute Preferences',
+ 'group' => 'contribute',
+ 'name' => 'cvv_backoffice_required',
+ 'type' => 'Boolean',
+ 'quick_form_type' => 'YesNo',
+ 'default' => '1',
+ 'add' => '4.1',
+ 'title' => 'CVV required for backoffice?',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => 'Is the CVV code required for back office credit card transactions',
+ 'help_text' => 'If set it back-office credit card transactions will required a cvv code. Leave as required unless you have a very strong reason to change',
+ ),
'contact_view_options' => array(
- 'group_name' => 'CiviCRM Preferences',
- 'group' => 'core',
- 'name' => 'contact_view_options',
- 'type' => 'String',
- 'html_type' => 'checkboxes',
- 'pseudoconstant' => array(
- 'optionGroupName' => 'contact_view_options',
- ),
- 'default' => array(
- '0' => '1',
- '1' => '2',
- '2' => '3',
- '3' => '4',
- '4' => '5',
- '5' => '6',
- '6' => '7',
- '7' => '8',
- '8' => '9',
- '9' => '10',
- '10' => '11',
- '11' => '13',
- ),
- 'add' => '4.1',
- 'title' => 'Viewing Contacts',
- 'is_domain' => '1',
- 'is_contact' => 0,
- 'description' => '',
- 'help_text' => '',
- ),
+ 'group_name' => 'CiviCRM Preferences',
+ 'group' => 'core',
+ 'name' => 'contact_view_options',
+ 'type' => 'String',
+ 'html_type' => 'checkboxes',
+ 'pseudoconstant' => array(
+ 'optionGroupName' => 'contact_view_options',
+ ),
+ 'default' => array(
+ '0' => '1',
+ '1' => '2',
+ '2' => '3',
+ '3' => '4',
+ '4' => '5',
+ '5' => '6',
+ '6' => '7',
+ '7' => '8',
+ '8' => '9',
+ '9' => '10',
+ '10' => '11',
+ '11' => '13',
+ ),
+ 'add' => '4.1',
+ 'title' => 'Viewing Contacts',
+ 'is_domain' => '1',
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => '',
+ ),
'contact_edit_options' => array(
- 'group_name' => 'CiviCRM Preferences',
- 'group' => 'core',
- 'name' => 'contact_edit_options',
- 'type' => 'String',
- 'html_type' => 'checkboxes',
- 'pseudoconstant' => array(
- 'optionGroupName' => 'contact_edit_options',
- ),
- 'default' => array(
- '0' => '1',
- '1' => '2',
- '2' => '3',
- '3' => '4',
- '4' => '5',
- '5' => '6',
- '6' => '7',
- '7' => '8',
- '8' => '9',
- '9' => '10',
- '10' => '11',
- ),
- 'add' => '4.1',
- 'title' => 'Editing Contacts',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => '',
- 'help_text' => '',
- ),
+ 'group_name' => 'CiviCRM Preferences',
+ 'group' => 'core',
+ 'name' => 'contact_edit_options',
+ 'type' => 'String',
+ 'html_type' => 'checkboxes',
+ 'pseudoconstant' => array(
+ 'optionGroupName' => 'contact_edit_options',
+ ),
+ 'default' => array(
+ '0' => '1',
+ '1' => '2',
+ '2' => '3',
+ '3' => '4',
+ '4' => '5',
+ '5' => '6',
+ '6' => '7',
+ '7' => '8',
+ '8' => '9',
+ '9' => '10',
+ '10' => '11',
+ ),
+ 'add' => '4.1',
+ 'title' => 'Editing Contacts',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => '',
+ ),
'advanced_search_options' => array(
- 'group_name' => 'CiviCRM Preferences',
- 'name' => 'advanced_search_options',
- 'type' => 'String',
- 'html_type' => 'checkboxes',
- 'pseudoconstant' => array(
- 'optionGroupName' => 'advanced_search_options',
- ),
- 'default' => array(
- '0' => '1',
- '1' => '2',
- '2' => '3',
- '3' => '4',
- '4' => '5',
- '5' => '6',
- '6' => '7',
- '7' => '8',
- '8' => '9',
- '9' => '10',
- '10' => '12',
- '11' => '13',
- '12' => '15',
- '13' => '16',
- '14' => '17',
- '15' => '18',
- '16' => '19',
- ),
- 'add' => '4.1',
- 'title' => 'Contact Search',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => '',
- 'help_text' => '',
- ),
+ 'group_name' => 'CiviCRM Preferences',
+ 'name' => 'advanced_search_options',
+ 'type' => 'String',
+ 'html_type' => 'checkboxes',
+ 'pseudoconstant' => array(
+ 'optionGroupName' => 'advanced_search_options',
+ ),
+ 'default' => array(
+ '0' => '1',
+ '1' => '2',
+ '2' => '3',
+ '3' => '4',
+ '4' => '5',
+ '5' => '6',
+ '6' => '7',
+ '7' => '8',
+ '8' => '9',
+ '9' => '10',
+ '10' => '12',
+ '11' => '13',
+ '12' => '15',
+ '13' => '16',
+ '14' => '17',
+ '15' => '18',
+ '16' => '19',
+ ),
+ 'add' => '4.1',
+ 'title' => 'Contact Search',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => '',
+ ),
'user_dashboard_options' => array(
- 'group_name' => 'CiviCRM Preferences',
- 'group' => 'core',
- 'name' => 'user_dashboard_options',
- 'type' => 'String',
- 'html_type' => 'checkboxes',
- 'pseudoconstant' => array(
- 'optionGroupName' => 'user_dashboard_options',
- ),
- 'default' => array(
- '0' => '1',
- '1' => '2',
- '2' => '3',
- '3' => '4',
- '4' => '5',
- '5' => '7',
- '6' => '8',
- '7' => '9',
- ),
- 'add' => '4.1',
- 'title' => 'Contact Dashboard',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => '',
- 'help_text' => '',
- ),
+ 'group_name' => 'CiviCRM Preferences',
+ 'group' => 'core',
+ 'name' => 'user_dashboard_options',
+ 'type' => 'String',
+ 'html_type' => 'checkboxes',
+ 'pseudoconstant' => array(
+ 'optionGroupName' => 'user_dashboard_options',
+ ),
+ 'default' => array(
+ '0' => '1',
+ '1' => '2',
+ '2' => '3',
+ '3' => '4',
+ '4' => '5',
+ '5' => '7',
+ '6' => '8',
+ '7' => '9',
+ ),
+ 'add' => '4.1',
+ 'title' => 'Contact Dashboard',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => '',
+ ),
'address_options' => array(
- 'group_name' => 'CiviCRM Preferences',
- 'group' => 'core',
- 'name' => 'address_options',
- 'type' => 'String',
- 'html_type' => 'Text',
- 'pseudoconstant' => array(
- 'optionGroupName' => 'address_options',
- ),
- 'default' => array(
- '0' => '1',
- '1' => '2',
- '2' => '4',
- '3' => '5',
- '4' => '8',
- '5' => '9',
- '6' => '10',
- '7' => '11',
- ),
- 'add' => '4.1',
- 'title' => 'Addressing Options',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => '',
- 'help_text' => '',
- ),
+ 'group_name' => 'CiviCRM Preferences',
+ 'group' => 'core',
+ 'name' => 'address_options',
+ 'type' => 'String',
+ 'html_type' => 'Text',
+ 'pseudoconstant' => array(
+ 'optionGroupName' => 'address_options',
+ ),
+ 'default' => array(
+ '0' => '1',
+ '1' => '2',
+ '2' => '4',
+ '3' => '5',
+ '4' => '8',
+ '5' => '9',
+ '6' => '10',
+ '7' => '11',
+ ),
+ 'add' => '4.1',
+ 'title' => 'Addressing Options',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => '',
+ ),
'address_format' => array(
- 'group_name' => 'CiviCRM Preferences',
- 'group' => 'core',
- 'name' => 'address_format',
- 'type' => 'String',
- 'html_type' => 'TextArea',
- 'default' => '{contact.address_name}
+ 'group_name' => 'CiviCRM Preferences',
+ 'group' => 'core',
+ 'name' => 'address_format',
+ 'type' => 'String',
+ 'html_type' => 'TextArea',
+ 'default' => '{contact.address_name}
{contact.street_address}
{contact.supplemental_address_1}
{contact.supplemental_address_2}
{contact.city}{, }{contact.state_province}{ }{contact.postal_code}
{contact.country}',
- 'add' => '4.1',
- 'title' => 'Address Format',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => '',
- 'help_text' => '',
- ),
+ 'add' => '4.1',
+ 'title' => 'Address Format',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => '',
+ ),
'mailing_format' => array(
- 'group_name' => 'CiviCRM Preferences',
- 'group' => 'core',
- 'name' => 'mailing_format',
- 'type' => 'String',
- 'html_type' => 'Text',
- 'default' => '{contact.addressee}
+ 'group_name' => 'CiviCRM Preferences',
+ 'group' => 'core',
+ 'name' => 'mailing_format',
+ 'type' => 'String',
+ 'html_type' => 'Text',
+ 'default' => '{contact.addressee}
{contact.street_address}
{contact.supplemental_address_1}
{contact.supplemental_address_2}
{contact.city}{, }{contact.state_province}{ }{contact.postal_code}
{contact.country}',
- 'add' => '4.1',
- 'title' => 'Mailing Format',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => '',
- 'help_text' => '',
- ),
+ 'add' => '4.1',
+ 'title' => 'Mailing Format',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => '',
+ ),
'display_name_format' => array(
- 'group_name' => 'CiviCRM Preferences',
- 'group' => 'core',
- 'name' => 'display_name_format',
- 'type' => 'String',
- 'html_type' => 'Text',
- 'default' => '{contact.individual_prefix}{ }{contact.first_name}{ }{contact.last_name}{ }{contact.individual_suffix}',
- 'add' => '4.1',
- 'title' => 'Display Name Format',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => '',
- 'help_text' => '',
- ),
+ 'group_name' => 'CiviCRM Preferences',
+ 'group' => 'core',
+ 'name' => 'display_name_format',
+ 'type' => 'String',
+ 'html_type' => 'Text',
+ 'default' => '{contact.individual_prefix}{ }{contact.first_name}{ }{contact.last_name}{ }{contact.individual_suffix}',
+ 'add' => '4.1',
+ 'title' => 'Display Name Format',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => '',
+ ),
'sort_name_format' => array(
- 'group_name' => 'CiviCRM Preferences',
- 'group' => 'core',
- 'name' => 'sort_name_format',
- 'type' => 'String',
- 'html_type' => 'Text',
- 'default' => '{contact.last_name}{, }{contact.first_name}',
- 'add' => '4.1',
- 'title' => 'Sort Name Format',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => '',
- 'help_text' => '',
- ),
+ 'group_name' => 'CiviCRM Preferences',
+ 'group' => 'core',
+ 'name' => 'sort_name_format',
+ 'type' => 'String',
+ 'html_type' => 'Text',
+ 'default' => '{contact.last_name}{, }{contact.first_name}',
+ 'add' => '4.1',
+ 'title' => 'Sort Name Format',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => '',
+ ),
'editor_id' => array(
- 'group_name' => 'CiviCRM Preferences',
- 'group' => 'core',
- 'name' => 'editor_id',
- 'type' => 'String',
- 'html_type' => 'Text',
- 'default' => '',
- 'add' => '4.1',
- 'title' => 'Wysiwig Editor',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => '',
- 'help_text' => '',
- ),
+ 'group_name' => 'CiviCRM Preferences',
+ 'group' => 'core',
+ 'name' => 'editor_id',
+ 'type' => 'String',
+ 'html_type' => 'Text',
+ 'default' => '',
+ 'add' => '4.1',
+ 'title' => 'Wysiwig Editor',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => '',
+ ),
'contact_ajax_check_similar' => array(
- 'group_name' => 'CiviCRM Preferences',
- 'group' => 'core',
- 'name' => 'contact_ajax_check_similar',
- 'type' => 'String',
- 'html_type' => 'Text',
- 'default' => '',
- 'add' => '4.1',
- 'title' => 'Ajax Check Similar',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => '',
- 'help_text' => '',
- ),
+ 'group_name' => 'CiviCRM Preferences',
+ 'group' => 'core',
+ 'name' => 'contact_ajax_check_similar',
+ 'type' => 'String',
+ 'html_type' => 'Text',
+ 'default' => '',
+ 'add' => '4.1',
+ 'title' => 'Ajax Check Similar',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => '',
+ ),
'ajaxPopupsEnabled' => array(
- 'group_name' => 'CiviCRM Preferences',
- 'group' => 'core',
- 'name' => 'ajaxPopupsEnabled',
- 'type' => 'Boolean',
- 'quick_form_type' => 'YesNo',
- 'default' => 1,
- 'add' => '4.5',
- 'title' => 'Ajax Popups Enabled',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => '',
- 'help_text' => '',
- ),
+ 'group_name' => 'CiviCRM Preferences',
+ 'group' => 'core',
+ 'name' => 'ajaxPopupsEnabled',
+ 'type' => 'Boolean',
+ 'quick_form_type' => 'YesNo',
+ 'default' => 1,
+ 'add' => '4.5',
+ 'title' => 'Ajax Popups Enabled',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => '',
+ ),
'activity_assignee_notification' => array(
- 'group_name' => 'CiviCRM Preferences',
- 'group' => 'core',
- 'name' => 'activity_assignee_notification',
- 'type' => 'String',
- 'html_type' => 'Text',
- 'default' => '',
- 'add' => '4.1',
- 'title' => 'Notify Activity Assignees',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => '',
- 'help_text' => '',
- ),
+ 'group_name' => 'CiviCRM Preferences',
+ 'group' => 'core',
+ 'name' => 'activity_assignee_notification',
+ 'type' => 'String',
+ 'html_type' => 'Text',
+ 'default' => '',
+ 'add' => '4.1',
+ 'title' => 'Notify Activity Assignees',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => '',
+ ),
'activity_assignee_notification_ics' => array(
- 'group_name' => 'CiviCRM Preferences',
- 'group' => 'core',
- 'name' => 'activity_assignee_notification_ics',
- 'type' => 'String',
- 'html_type' => 'Text',
- 'default' => '',
- 'add' => '4.3',
- 'title' => 'Include ICal Invite to Activity Assignees',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => '',
- 'help_text' => '',
- ),
+ 'group_name' => 'CiviCRM Preferences',
+ 'group' => 'core',
+ 'name' => 'activity_assignee_notification_ics',
+ 'type' => 'String',
+ 'html_type' => 'Text',
+ 'default' => '',
+ 'add' => '4.3',
+ 'title' => 'Include ICal Invite to Activity Assignees',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => '',
+ ),
'contact_autocomplete_options' => array(
- 'group_name' => 'CiviCRM Preferences',
- 'group' => 'core',
- 'name' => 'contact_autocomplete_options',
- 'type' => 'String',
- 'html_type' => 'checkboxes',
- 'pseudoconstant' => array(
- 'optionGroupName' => 'contact_autocomplete_options',
- ),
- 'default' => array(
- '0' => '1',
- '1' => '2',
- '2' => '3',
- '3' => '4',
- '4' => '5',
- '5' => '6',
- '6' => '7',
- ),
- 'add' => '4.1',
- 'title' => 'Contact Reference Autocomplete Options',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => '',
- 'help_text' => '',
- ),
+ 'group_name' => 'CiviCRM Preferences',
+ 'group' => 'core',
+ 'name' => 'contact_autocomplete_options',
+ 'type' => 'String',
+ 'html_type' => 'checkboxes',
+ 'pseudoconstant' => array(
+ 'optionGroupName' => 'contact_autocomplete_options',
+ ),
+ 'default' => array(
+ '0' => '1',
+ '1' => '2',
+ '2' => '3',
+ '3' => '4',
+ '4' => '5',
+ '5' => '6',
+ '6' => '7',
+ ),
+ 'add' => '4.1',
+ 'title' => 'Contact Reference Autocomplete Options',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => '',
+ ),
'contact_reference_options' => array(
- 'group_name' => 'CiviCRM Preferences',
- 'group' => 'core',
- 'name' => 'contact_reference_options',
- 'type' => 'String',
- 'html_type' => 'checkboxes',
- 'pseudoconstant' => array(
- 'optionGroupName' => 'contact_reference_options',
- ),
- 'default' => array(
- '0' => '1',
- '1' => '2',
- '2' => '3',
- '3' => '4',
- '4' => '5',
- '5' => '6',
- '6' => '7',
- ),
- 'add' => '4.1',
- 'title' => 'Contact Reference Options',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => '',
- 'help_text' => '',
- ),
+ 'group_name' => 'CiviCRM Preferences',
+ 'group' => 'core',
+ 'name' => 'contact_reference_options',
+ 'type' => 'String',
+ 'html_type' => 'checkboxes',
+ 'pseudoconstant' => array(
+ 'optionGroupName' => 'contact_reference_options',
+ ),
+ 'default' => array(
+ '0' => '1',
+ '1' => '2',
+ '2' => '3',
+ '3' => '4',
+ '4' => '5',
+ '5' => '6',
+ '6' => '7',
+ ),
+ 'add' => '4.1',
+ 'title' => 'Contact Reference Options',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => '',
+ ),
'max_attachments' => array(
- 'group_name' => 'CiviCRM Preferences',
- 'group' => 'core',
- 'name' => 'max_attachments',
- 'legacy_key' => 'maxAttachments',
- 'prefetch' => 0,
- 'type' => 'Integer',
- 'quick_form_type' => 'Element',
- 'html_type' => 'text',
- 'html_attributes' => array(
- 'size' => 2,
- 'maxlength' => 8,
- ),
- 'default' => 3,
- 'add' => '4.3',
- 'title' => 'Maximum Attachments',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => 'Maximum number of files (documents, images, etc.) which can attached to emails or activities.',
- 'help_text' => '',
- ),
+ 'group_name' => 'CiviCRM Preferences',
+ 'group' => 'core',
+ 'name' => 'max_attachments',
+ 'legacy_key' => 'maxAttachments',
+ 'prefetch' => 0,
+ 'type' => 'Integer',
+ 'quick_form_type' => 'Element',
+ 'html_type' => 'text',
+ 'html_attributes' => array(
+ 'size' => 2,
+ 'maxlength' => 8,
+ ),
+ 'default' => 3,
+ 'add' => '4.3',
+ 'title' => 'Maximum Attachments',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => 'Maximum number of files (documents, images, etc.) which can attached to emails or activities.',
+ 'help_text' => '',
+ ),
'maxFileSize' => array(
- 'group_name' => 'CiviCRM Preferences',
- 'group' => 'core',
- 'name' => 'maxFileSize',
- 'prefetch' => 1,
- 'config_only' => 1,
- 'type' => 'Integer',
- 'quick_form_type' => 'Element',
- 'html_type' => 'text',
- 'html_attributes' => array(
- 'size' => 2,
- 'maxlength' => 8,
- ),
- 'default' => 3,
- 'add' => '4.3',
- 'title' => 'Maximum File Size (in MB)',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => 'Maximum Size of file (documents, images, etc.) which can attached to emails or activities.<br />Note: php.ini should support this file size.',
- 'help_text' => '',
- ),
+ 'group_name' => 'CiviCRM Preferences',
+ 'group' => 'core',
+ 'name' => 'maxFileSize',
+ 'prefetch' => 1,
+ 'config_only' => 1,
+ 'type' => 'Integer',
+ 'quick_form_type' => 'Element',
+ 'html_type' => 'text',
+ 'html_attributes' => array(
+ 'size' => 2,
+ 'maxlength' => 8,
+ ),
+ 'default' => 3,
+ 'add' => '4.3',
+ 'title' => 'Maximum File Size (in MB)',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => 'Maximum Size of file (documents, images, etc.) which can attached to emails or activities.<br />Note: php.ini should support this file size.',
+ 'help_text' => '',
+ ),
'contact_undelete' => array(
- 'group_name' => 'CiviCRM Preferences',
- 'group' => 'core',
- 'name' => 'contact_undelete',
- 'type' => 'Boolean',
- 'quick_form_type' => 'YesNo',
- 'default' => 1,
- 'add' => '4.3',
- 'title' => 'Contact Trash and Undelete',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => 'If enabled, deleted contacts will be moved to trash (instead of being destroyed). Users with the proper permission are able to search for the deleted contacts and restore them (or delete permanently).',
- 'help_text' => '',
- ),
+ 'group_name' => 'CiviCRM Preferences',
+ 'group' => 'core',
+ 'name' => 'contact_undelete',
+ 'type' => 'Boolean',
+ 'quick_form_type' => 'YesNo',
+ 'default' => 1,
+ 'add' => '4.3',
+ 'title' => 'Contact Trash and Undelete',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => 'If enabled, deleted contacts will be moved to trash (instead of being destroyed). Users with the proper permission are able to search for the deleted contacts and restore them (or delete permanently).',
+ 'help_text' => '',
+ ),
'allowPermDeleteFinancial' => array(
- 'group_name' => 'CiviCRM Preferences',
- 'group' => 'core',
- 'name' => 'allowPermDeleteFinancial',
- 'type' => 'Boolean',
- 'quick_form_type' => 'YesNo',
- 'default' => '',
- 'add' => '4.3',
- 'title' => 'Contact Permanent Delete',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => 'Allow Permanent Delete for contacts who are linked to live financial transactions',
- 'help_text' => '',
- ),
+ 'group_name' => 'CiviCRM Preferences',
+ 'group' => 'core',
+ 'name' => 'allowPermDeleteFinancial',
+ 'type' => 'Boolean',
+ 'quick_form_type' => 'YesNo',
+ 'default' => '',
+ 'add' => '4.3',
+ 'title' => 'Contact Permanent Delete',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => 'Allow Permanent Delete for contacts who are linked to live financial transactions',
+ 'help_text' => '',
+ ),
'versionAlert' => array(
- 'group_name' => 'CiviCRM Preferences',
- 'group' => 'core',
- 'name' => 'versionAlert',
- 'type' => 'Boolean',
- 'quick_form_type' => 'YesNo',
- 'default' => 1,
- 'add' => '4.3',
- 'title' => 'New Version Alerts',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => 'Displays an on-screen alert to users with \"Administer CiviCRM\" permissions when a new version of CiviCRM is available. This setting will only work if the \"Version Check & Statistics Reporting\" setting is enabled.',
- 'help_text' => '',
- ),
+ 'group_name' => 'CiviCRM Preferences',
+ 'group' => 'core',
+ 'name' => 'versionAlert',
+ 'type' => 'Integer',
+ 'quick_form_type' => 'Element',
+ 'html_type' => 'select',
+ 'option_values' => array(
+ '0' => 'Disabled',
+ '1' => 'Display In Page Footer',
+ '2' => 'Display As Popup Alert',
+ '3' => 'Page Footer + Popup Alert',
+ ),
+ 'default' => 1,
+ 'add' => '4.3',
+ 'title' => 'New Version Alerts',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => '',
+ ),
+ 'securityUpdateAlert' => array(
+ 'group_name' => 'CiviCRM Preferences',
+ 'group' => 'core',
+ 'name' => 'securityUpdateAlert',
+ 'type' => 'Integer',
+ 'quick_form_type' => 'Element',
+ 'html_type' => 'select',
+ 'option_values' => array(
+ '0' => 'Disabled',
+ '1' => 'Display In Page Footer',
+ '2' => 'Display As Popup Alert',
+ '3' => 'Page Footer + Popup Alert',
+ ),
+ 'default' => 3,
+ 'add' => '4.6',
+ 'title' => 'Security Update Alerts',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => '',
+ ),
'versionCheck' => array(
- 'group_name' => 'CiviCRM Preferences',
- 'group' => 'core',
- 'name' => 'versionCheck',
- 'prefetch' => 1,
- 'config_only' => 1,
- 'type' => 'Boolean',
- 'quick_form_type' => 'YesNo',
- 'default' => 1,
- 'add' => '4.3',
- 'title' => 'Version Check & Statistics Reporting',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => 'If enabled, CiviCRM automatically checks availablity of a newer version of the software. New version alerts will be displayed on the main CiviCRM Administration page.
-When enabled, statistics about your CiviCRM installation are reported anonymously to the CiviCRM team to assist in prioritizing ongoing development efforts. The following information is gathered: CiviCRM version, versions of PHP, MySQL and framework (Drupal/Joomla/standalone), and default language. Counts (but no actual data) of the following record types are reported: contacts, activities, cases, relationships, contributions, contribution pages, contribution products, contribution widgets, discounts, price sets, profiles, events, participants, tell-a-friend pages, grants, mailings, memberships, membership blocks, pledges, pledge blocks and active payment processor types.',
- 'help_text' => '',
- ),
+ 'group_name' => 'CiviCRM Preferences',
+ 'group' => 'core',
+ 'name' => 'versionCheck',
+ 'type' => 'Boolean',
+ 'quick_form_type' => 'YesNo',
+ 'default' => 1,
+ 'add' => '4.3',
+ 'title' => 'Automatically Check for Updates',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => '',
+ ),
+ 'versionCheckIgnoreDate' => array(
+ 'group_name' => 'CiviCRM Preferences',
+ 'group' => 'core',
+ 'name' => 'versionCheckIgnoreDate',
+ 'type' => 'String',
+ 'quick_form_type' => 'Element',
+ 'html_type' => 'text',
+ 'html_attributes' => array(
+ 'placeholder' => 'YYYY-MM-DD',
+ ),
+ 'default' => '',
+ 'add' => '4.6',
+ 'title' => 'Ignore Updates Prior to',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => '',
+ ),
'securityAlert' => array(
- 'group_name' => 'CiviCRM Preferences',
- 'group' => 'core',
- 'name' => 'versionCheck',
- 'prefetch' => 0,
- 'type' => 'Boolean',
- 'quick_form_type' => 'YesNo',
- 'default' => 1,
- 'add' => '4.4',
- 'title' => 'Security Alerts',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => 'If enabled, CiviCRM will automatically run checks for significant mis-configurations such as ineffective file protections.',
- 'help_text' => '',
- ),
+ 'group_name' => 'CiviCRM Preferences',
+ 'group' => 'core',
+ 'name' => 'securityAlert',
+ 'type' => 'Boolean',
+ 'quick_form_type' => 'YesNo',
+ 'default' => 1,
+ 'add' => '4.4',
+ 'title' => 'Security Audits',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => 'If enabled, CiviCRM will automatically run checks for significant mis-configurations such as ineffective file protections.',
+ 'help_text' => '',
+ ),
'doNotAttachPDFReceipt' => array(
- 'group_name' => 'CiviCRM Preferences',
- 'group' => 'core',
- 'name' => 'doNotAttachPDFReceipt',
- 'prefetch' => 1,
- 'config_only' => 1,
- 'type' => 'Boolean',
- 'quick_form_type' => 'YesNo',
- 'default' => 1,
- 'add' => '4.3',
- 'title' => 'Attach PDF copy to receipts',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => 'If enabled, CiviCRM sends PDF receipt as an attachment during event signup or online contribution.',
- 'help_text' => '',
- ),
+ 'group_name' => 'CiviCRM Preferences',
+ 'group' => 'core',
+ 'name' => 'doNotAttachPDFReceipt',
+ 'prefetch' => 1,
+ 'config_only' => 1,
+ 'type' => 'Boolean',
+ 'quick_form_type' => 'YesNo',
+ 'default' => 1,
+ 'add' => '4.3',
+ 'title' => 'Attach PDF copy to receipts',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => 'If enabled, CiviCRM sends PDF receipt as an attachment during event signup or online contribution.',
+ 'help_text' => '',
+ ),
'wkhtmltopdfPath' => array(
- 'group_name' => 'CiviCRM Preferences',
- 'group' => 'core',
- 'name' => 'wkhtmltopdfPath',
- 'prefetch' => 1,
- 'config_only' => 1,
- 'type' => 'String',
- 'quick_form_type' => 'Element',
- 'html_type' => 'Text',
- 'html_attributes' => array(
- 'size' => 64,
- 'maxlength' => 256,
- ),
- 'default' => '',
- 'add' => '4.3',
- 'title' => 'Path to wkhtmltopdf executable',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => '',
- 'help_text' => '',
- ),
+ 'group_name' => 'CiviCRM Preferences',
+ 'group' => 'core',
+ 'name' => 'wkhtmltopdfPath',
+ 'prefetch' => 1,
+ 'config_only' => 1,
+ 'type' => 'String',
+ 'quick_form_type' => 'Element',
+ 'html_type' => 'Text',
+ 'html_attributes' => array(
+ 'size' => 64,
+ 'maxlength' => 256,
+ ),
+ 'default' => '',
+ 'add' => '4.3',
+ 'title' => 'Path to wkhtmltopdf executable',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => '',
+ ),
'recaptchaPublicKey' => array(
- 'group_name' => 'CiviCRM Preferences',
- 'group' => 'core',
- 'name' => 'recaptchaPublicKey',
- 'prefetch' => 1,
- 'config_only' => 1,
- 'type' => 'String',
- 'quick_form_type' => 'Element',
- 'html_type' => 'Text',
- 'html_attributes' => array(
- 'size' => 64,
- 'maxlength' => 64,
- ),
- 'default' => '',
- 'add' => '4.3',
- 'title' => 'Recaptcha Public Key',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => '',
- 'help_text' => '',
- ),
+ 'group_name' => 'CiviCRM Preferences',
+ 'group' => 'core',
+ 'name' => 'recaptchaPublicKey',
+ 'prefetch' => 1,
+ 'config_only' => 1,
+ 'type' => 'String',
+ 'quick_form_type' => 'Element',
+ 'html_type' => 'Text',
+ 'html_attributes' => array(
+ 'size' => 64,
+ 'maxlength' => 64,
+ ),
+ 'default' => '',
+ 'add' => '4.3',
+ 'title' => 'Recaptcha Public Key',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => '',
+ ),
'recaptchaPrivateKey' => array(
- 'group_name' => 'CiviCRM Preferences',
- 'group' => 'core',
- 'name' => 'recaptchaPrivateKey',
- 'prefetch' => 1,
- 'config_only' => 1,
- 'type' => 'String',
- 'quick_form_type' => 'Element',
- 'html_type' => 'Text',
- 'html_attributes' => array(
- 'size' => 64,
- 'maxlength' => 64,
- ),
- 'default' => '',
- 'add' => '4.3',
- 'title' => 'Recaptcha Private Key',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => '',
- 'help_text' => '',
- ),
+ 'group_name' => 'CiviCRM Preferences',
+ 'group' => 'core',
+ 'name' => 'recaptchaPrivateKey',
+ 'prefetch' => 1,
+ 'config_only' => 1,
+ 'type' => 'String',
+ 'quick_form_type' => 'Element',
+ 'html_type' => 'Text',
+ 'html_attributes' => array(
+ 'size' => 64,
+ 'maxlength' => 64,
+ ),
+ 'default' => '',
+ 'add' => '4.3',
+ 'title' => 'Recaptcha Private Key',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => '',
+ ),
'dashboardCacheTimeout' => array(
- 'group_name' => 'CiviCRM Preferences',
- 'group' => 'core',
- 'name' => 'dashboardCacheTimeout',
- 'prefetch' => 1,
- 'config_only' => 1,
- 'type' => 'Integer',
- 'quick_form_type' => 'Element',
- 'html_type' => 'Text',
- 'html_attributes' => array(
- 'size' => 3,
- 'maxlength' => 5,
- ),
- 'default' => '',
- 'add' => '4.3',
- 'title' => 'Dashboard cache timeout',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => '',
- 'help_text' => '',
- ),
+ 'group_name' => 'CiviCRM Preferences',
+ 'group' => 'core',
+ 'name' => 'dashboardCacheTimeout',
+ 'prefetch' => 1,
+ 'config_only' => 1,
+ 'type' => 'Integer',
+ 'quick_form_type' => 'Element',
+ 'html_type' => 'Text',
+ 'html_attributes' => array(
+ 'size' => 3,
+ 'maxlength' => 5,
+ ),
+ 'default' => '',
+ 'add' => '4.3',
+ 'title' => 'Dashboard cache timeout',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => '',
+ ),
'checksumTimeout' => array(
- 'group_name' => 'CiviCRM Preferences',
- 'group' => 'core',
- 'name' => 'checksumTimeout',
- 'prefetch' => 1,
- 'type' => 'Integer',
- 'quick_form_type' => 'Element',
- 'html_type' => 'Text',
- 'html_attributes' => array(
- 'size' => 2,
- 'maxlength' => 8,
- ),
- 'default' => 7,
- 'add' => '4.3',
- 'title' => 'Checksum Lifespan',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => '',
- 'help_text' => '',
- ),
+ 'group_name' => 'CiviCRM Preferences',
+ 'group' => 'core',
+ 'name' => 'checksumTimeout',
+ 'prefetch' => 1,
+ 'type' => 'Integer',
+ 'quick_form_type' => 'Element',
+ 'html_type' => 'Text',
+ 'html_attributes' => array(
+ 'size' => 2,
+ 'maxlength' => 8,
+ ),
+ 'default' => 7,
+ 'add' => '4.3',
+ 'title' => 'Checksum Lifespan',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => '',
+ ),
'blogUrl' => array(
- 'group_name' => 'CiviCRM Preferences',
- 'group' => 'core',
- 'name' => 'blogUrl',
- 'prefetch' => 0,
- 'type' => 'String',
- 'quick_form_type' => 'Element',
- 'html_type' => 'Text',
- 'html_attributes' => array(
- 'size' => 64,
- 'maxlength' => 128,
- ),
- 'default' => '*default*',
- 'add' => '4.3',
- 'title' => 'Blog Feed URL',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => 'Blog feed URL used by the blog dashlet',
- 'help_text' => 'Use \"*default*\" for the system default or override with a custom URL',
- ),
+ 'group_name' => 'CiviCRM Preferences',
+ 'group' => 'core',
+ 'name' => 'blogUrl',
+ 'prefetch' => 0,
+ 'type' => 'String',
+ 'quick_form_type' => 'Element',
+ 'html_type' => 'Text',
+ 'html_attributes' => array(
+ 'size' => 64,
+ 'maxlength' => 128,
+ ),
+ 'default' => '*default*',
+ 'add' => '4.3',
+ 'title' => 'Blog Feed URL',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => 'Blog feed URL used by the blog dashlet',
+ 'help_text' => 'Use \"*default*\" for the system default or override with a custom URL',
+ ),
'communityMessagesUrl' => array(
- 'group_name' => 'CiviCRM Preferences',
- 'group' => 'core',
- 'name' => 'communityMessagesUrl',
- 'prefetch' => 0,
- 'type' => 'String',
- 'quick_form_type' => 'Element',
- 'html_type' => 'Text',
- 'html_attributes' => array(
- 'size' => 64,
- 'maxlength' => 128,
- ),
- 'default' => '*default*',
- 'add' => '4.3',
- 'title' => 'Community Messages URL',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => 'Service providing CiviCRM community messages',
- 'help_text' => 'Use \"*default*\" for the system default or override with a custom URL',
- ),
+ 'group_name' => 'CiviCRM Preferences',
+ 'group' => 'core',
+ 'name' => 'communityMessagesUrl',
+ 'prefetch' => 0,
+ 'type' => 'String',
+ 'quick_form_type' => 'Element',
+ 'html_type' => 'Text',
+ 'html_attributes' => array(
+ 'size' => 64,
+ 'maxlength' => 128,
+ ),
+ 'default' => '*default*',
+ 'add' => '4.3',
+ 'title' => 'Community Messages URL',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => 'Service providing CiviCRM community messages',
+ 'help_text' => 'Use \"*default*\" for the system default or override with a custom URL',
+ ),
'resCacheCode' => array(
- 'group_name' => 'CiviCRM Preferences',
- 'group' => 'core',
- 'name' => 'resCacheCode',
- 'prefetch' => 1,
- 'config_only' => 1,
- 'type' => 'String',
- 'quick_form_type' => 'Element',
- 'html_type' => 'Text',
- 'html_attributes' => array(
- 'size' => 16,
- 'maxlength' => 16,
- ),
- 'default' => '',
- 'add' => '4.3',
- 'title' => 'Resource Cache Code',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => 'Code appended to resource URLs (JS/CSS) to coerce HTTP caching',
- 'help_text' => '',
- ),
+ 'group_name' => 'CiviCRM Preferences',
+ 'group' => 'core',
+ 'name' => 'resCacheCode',
+ 'prefetch' => 1,
+ 'config_only' => 1,
+ 'type' => 'String',
+ 'quick_form_type' => 'Element',
+ 'html_type' => 'Text',
+ 'html_attributes' => array(
+ 'size' => 16,
+ 'maxlength' => 16,
+ ),
+ 'default' => '',
+ 'add' => '4.3',
+ 'title' => 'Resource Cache Code',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => 'Code appended to resource URLs (JS/CSS) to coerce HTTP caching',
+ 'help_text' => '',
+ ),
'verifySSL' => array(
- 'group_name' => 'CiviCRM Preferences',
- 'group' => 'core',
- 'name' => 'verifySSL',
- 'type' => 'Boolean',
- 'quick_form_type' => 'YesNo',
- 'default' => 1,
- 'add' => '4.3',
- 'title' => 'Verify SSL?',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => 'If disabled, backend HTTPS services will allow unverified, insecure connections',
- 'help_text' => 'Unless you are absolutely unable to configure your server to check the SSL certificate of the remote server you should leave this set to Yes',
- ),
+ 'group_name' => 'CiviCRM Preferences',
+ 'group' => 'core',
+ 'name' => 'verifySSL',
+ 'type' => 'Boolean',
+ 'quick_form_type' => 'YesNo',
+ 'default' => 1,
+ 'add' => '4.3',
+ 'title' => 'Verify SSL?',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => 'If disabled, backend HTTPS services will allow unverified, insecure connections',
+ 'help_text' => 'Unless you are absolutely unable to configure your server to check the SSL certificate of the remote server you should leave this set to Yes',
+ ),
'wpBasePage' => array(
- 'group_name' => 'CiviCRM Preferences',
- 'group' => 'core',
- 'name' => 'wpBasePage',
- 'type' => 'String',
- 'html_type' => 'text',
- 'quick_form_type' => 'Element',
- 'prefetch' => 1,
- 'default' => '',
- 'add' => '4.3',
- 'title' => 'WordPress Base Page',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => 'If set, CiviCRM will use this setting as the base url.',
- 'help_text' => 'By default, CiviCRM will generate front-facing pages using the home page at http://wp/ as its base. If you want to use a different template for CiviCRM pages, set the path here.',
- ),
+ 'group_name' => 'CiviCRM Preferences',
+ 'group' => 'core',
+ 'name' => 'wpBasePage',
+ 'type' => 'String',
+ 'html_type' => 'text',
+ 'quick_form_type' => 'Element',
+ 'prefetch' => 1,
+ 'default' => '',
+ 'add' => '4.3',
+ 'title' => 'WordPress Base Page',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => 'If set, CiviCRM will use this setting as the base url.',
+ 'help_text' => 'By default, CiviCRM will generate front-facing pages using the home page at http://wp/ as its base. If you want to use a different template for CiviCRM pages, set the path here.',
+ ),
'secondDegRelPermissions' => array(
- 'group_name' => 'CiviCRM Preferences',
- 'group' => 'core',
- 'name' => 'secondDegRelPermissions',
- 'prefetch' => 1,
- 'type' => 'Boolean',
- 'quick_form_type' => 'YesNo',
- 'default' => 0,
- 'add' => '4.3',
- 'title' => 'Allow second-degree relationship permissions',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => 'If enabled, contacts with the permission to edit a related contact will inherit that contact\'s permission to edit other related contacts',
- 'help_text' => '',
- ),
+ 'group_name' => 'CiviCRM Preferences',
+ 'group' => 'core',
+ 'name' => 'secondDegRelPermissions',
+ 'prefetch' => 1,
+ 'type' => 'Boolean',
+ 'quick_form_type' => 'YesNo',
+ 'default' => 0,
+ 'add' => '4.3',
+ 'title' => 'Allow second-degree relationship permissions',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => 'If enabled, contacts with the permission to edit a related contact will inherit that contact\'s permission to edit other related contacts',
+ 'help_text' => '',
+ ),
'enable_components' => array(
- 'group_name' => 'CiviCRM Preferences',
- 'group' => 'core',
- 'name' => 'enable_components',
- 'type' => 'Array',
- 'quick_form_type' => 'Element',
- 'html_type' => 'advmultiselect',
- 'html_attributes' => array(
- 'size' => 5,
- 'style' => 'width:150px',
- 'class' => 'advmultiselect',
- ),
- 'default' => array(
- '0' => 'CiviEvent',
- '1' => 'CiviContribute',
- '2' => 'CiviMember',
- '3' => 'CiviMail',
- '4' => 'CiviReport',
- '5' => 'CiviPledge',
- ),
- 'add' => '4.4',
- 'title' => 'Enable Components',
- 'is_domain' => '1',
- 'is_contact' => 0,
- 'description' => '',
- 'help_text' => '',
- 'on_change' => array(
- '0' => array(
- '0' => 'CRM_Case_Info',
- '1' => 'onToggleComponents',
- ),
- '1' => array(
- '0' => 'CRM_Core_Component',
- '1' => 'flushEnabledComponents',
- ),
- ),
- ),
+ 'group_name' => 'CiviCRM Preferences',
+ 'group' => 'core',
+ 'name' => 'enable_components',
+ 'type' => 'Array',
+ 'quick_form_type' => 'Element',
+ 'html_type' => 'advmultiselect',
+ 'html_attributes' => array(
+ 'size' => 5,
+ 'style' => 'width:150px',
+ 'class' => 'advmultiselect',
+ ),
+ 'default' => array(
+ '0' => 'CiviEvent',
+ '1' => 'CiviContribute',
+ '2' => 'CiviMember',
+ '3' => 'CiviMail',
+ '4' => 'CiviReport',
+ '5' => 'CiviPledge',
+ ),
+ 'add' => '4.4',
+ 'title' => 'Enable Components',
+ 'is_domain' => '1',
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => '',
+ 'on_change' => array(
+ '0' => array(
+ '0' => 'CRM_Case_Info',
+ '1' => 'onToggleComponents',
+ ),
+ '1' => array(
+ '0' => 'CRM_Core_Component',
+ '1' => 'flushEnabledComponents',
+ ),
+ ),
+ ),
'disable_core_css' => array(
- 'group_name' => 'CiviCRM Preferences',
- 'group' => 'core',
- 'name' => 'disable_core_css',
- 'type' => 'Boolean',
- 'quick_form_type' => 'YesNo',
- 'default' => 0,
- 'add' => '4.4',
- 'title' => 'Disable CiviCRM css',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => 'Prevent the stylesheet \"civicrm.css\" from being loaded.',
- 'help_text' => '',
- ),
+ 'group_name' => 'CiviCRM Preferences',
+ 'group' => 'core',
+ 'name' => 'disable_core_css',
+ 'type' => 'Boolean',
+ 'quick_form_type' => 'YesNo',
+ 'default' => 0,
+ 'add' => '4.4',
+ 'title' => 'Disable CiviCRM css',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => 'Prevent the stylesheet \"civicrm.css\" from being loaded.',
+ 'help_text' => '',
+ ),
'empoweredBy' => array(
- 'group_name' => 'CiviCRM Preferences',
- 'group' => 'core',
- 'name' => 'empoweredBy',
- 'prefetch' => 1,
- 'type' => 'Boolean',
- 'quick_form_type' => 'YesNo',
- 'default' => 1,
- 'add' => '4.5',
- 'title' => 'Display \"empowered by CiviCRM\"',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => 'When enabled, \"empowered by CiviCRM\" is displayed at the bottom of public forms.',
- 'help_text' => '',
- ),
+ 'group_name' => 'CiviCRM Preferences',
+ 'group' => 'core',
+ 'name' => 'empoweredBy',
+ 'prefetch' => 1,
+ 'type' => 'Boolean',
+ 'quick_form_type' => 'YesNo',
+ 'default' => 1,
+ 'add' => '4.5',
+ 'title' => 'Display \"empowered by CiviCRM\"',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => 'When enabled, \"empowered by CiviCRM\" is displayed at the bottom of public forms.',
+ 'help_text' => '',
+ ),
'debug_enabled' => array(
- 'group_name' => 'Developer Preferences',
- 'group' => 'developer',
- 'name' => 'debug_enabled',
- 'config_key' => 'debug',
- 'type' => 'Boolean',
- 'quick_form_type' => 'YesNo',
- 'default' => 0,
- 'add' => '4.3',
- 'title' => 'Enable Debugging',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => 'Set this value to Yes if you want to use one of CiviCRM\'s debugging tools. This feature should NOT be enabled for production sites',
- 'prefetch' => 1,
- 'help_text' => 'Do not turn this on on production sites',
- ),
+ 'group_name' => 'Developer Preferences',
+ 'group' => 'developer',
+ 'name' => 'debug_enabled',
+ 'config_key' => 'debug',
+ 'type' => 'Boolean',
+ 'quick_form_type' => 'YesNo',
+ 'default' => 0,
+ 'add' => '4.3',
+ 'title' => 'Enable Debugging',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => 'Set this value to Yes if you want to use one of CiviCRM\'s debugging tools. This feature should NOT be enabled for production sites',
+ 'prefetch' => 1,
+ 'help_text' => 'Do not turn this on on production sites',
+ ),
'userFrameworkLogging' => array(
- 'group_name' => 'Developer Preferences',
- 'group' => 'developer',
- 'name' => 'userFrameworkLogging',
- 'type' => 'Boolean',
- 'quick_form_type' => 'YesNo',
- 'default' => 0,
- 'add' => '4.3',
- 'title' => 'Enable Drupal Watchdog Logging',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => 'Set this value to Yes if you want CiviCRM error/debugging messages to also appear in Drupal error logs',
- 'prefetch' => 1,
- 'help_text' => 'Set this value to Yes if you want CiviCRM error/debugging messages the appear in your CMS\' error log.
+ 'group_name' => 'Developer Preferences',
+ 'group' => 'developer',
+ 'name' => 'userFrameworkLogging',
+ 'type' => 'Boolean',
+ 'quick_form_type' => 'YesNo',
+ 'default' => 0,
+ 'add' => '4.3',
+ 'title' => 'Enable Drupal Watchdog Logging',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => 'Set this value to Yes if you want CiviCRM error/debugging messages to also appear in Drupal error logs',
+ 'prefetch' => 1,
+ 'help_text' => 'Set this value to Yes if you want CiviCRM error/debugging messages the appear in your CMS\' error log.
In the case of Drupal, this will cause all CiviCRM error messages to appear in the watchdog (assuming you have Drupal\'s watchdog enabled)',
- ),
+ ),
'backtrace' => array(
- 'group_name' => 'Developer Preferences',
- 'group' => 'developer',
- 'name' => 'backtrace',
- 'type' => 'Boolean',
- 'quick_form_type' => 'YesNo',
- 'default' => 0,
- 'add' => '4.3',
- 'title' => 'Display Backtrace',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => 'Set this value to Yes if you want to display a backtrace listing when a fatal error is encountered. This feature should NOT be enabled for production sites',
- 'prefetch' => 1,
- ),
+ 'group_name' => 'Developer Preferences',
+ 'group' => 'developer',
+ 'name' => 'backtrace',
+ 'type' => 'Boolean',
+ 'quick_form_type' => 'YesNo',
+ 'default' => 0,
+ 'add' => '4.3',
+ 'title' => 'Display Backtrace',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => 'Set this value to Yes if you want to display a backtrace listing when a fatal error is encountered. This feature should NOT be enabled for production sites',
+ 'prefetch' => 1,
+ ),
'fatalErrorTemplate' => array(
- 'group_name' => 'Developer Preferences',
- 'group' => 'developer',
- 'name' => 'fatalErrorTemplate',
- 'type' => 'String',
- 'quick_form_type' => 'Element',
- 'html_type' => 'text',
- 'default' => 'CRM/common/fatal.tpl',
- 'add' => '4.3',
- 'title' => 'Fatal Error Template',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => 'Enter the path and filename for a custom Smarty template if you want to define your own screen for displaying fatal errors.',
- 'prefetch' => 1,
- ),
+ 'group_name' => 'Developer Preferences',
+ 'group' => 'developer',
+ 'name' => 'fatalErrorTemplate',
+ 'type' => 'String',
+ 'quick_form_type' => 'Element',
+ 'html_type' => 'text',
+ 'default' => 'CRM/common/fatal.tpl',
+ 'add' => '4.3',
+ 'title' => 'Fatal Error Template',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => 'Enter the path and filename for a custom Smarty template if you want to define your own screen for displaying fatal errors.',
+ 'prefetch' => 1,
+ ),
'fatalErrorHandler' => array(
- 'group_name' => 'Developer Preferences',
- 'group' => 'developer',
- 'name' => 'fatalErrorHandler',
- 'type' => 'String',
- 'quick_form_type' => 'Element',
- 'html_type' => 'text',
- 'default' => '',
- 'add' => '4.3',
- 'title' => 'Fatal Error Handler',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => 'Enter the path and class for a custom PHP error-handling function if you want to override built-in CiviCRM error handling for your site.',
- 'prefetch' => 1,
- ),
+ 'group_name' => 'Developer Preferences',
+ 'group' => 'developer',
+ 'name' => 'fatalErrorHandler',
+ 'type' => 'String',
+ 'quick_form_type' => 'Element',
+ 'html_type' => 'text',
+ 'default' => '',
+ 'add' => '4.3',
+ 'title' => 'Fatal Error Handler',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => 'Enter the path and class for a custom PHP error-handling function if you want to override built-in CiviCRM error handling for your site.',
+ 'prefetch' => 1,
+ ),
'uploadDir' => array(
- 'group_name' => 'Directory Preferences',
- 'group' => 'directory',
- 'name' => 'uploadDir',
- 'type' => 'Url',
- 'html_type' => 'Text',
- 'default' => '',
- 'add' => '4.1',
- 'prefetch' => 1,
- 'title' => 'Upload Directory',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => '',
- 'help_text' => '',
- ),
+ 'group_name' => 'Directory Preferences',
+ 'group' => 'directory',
+ 'name' => 'uploadDir',
+ 'type' => 'Url',
+ 'html_type' => 'Text',
+ 'default' => '',
+ 'add' => '4.1',
+ 'prefetch' => 1,
+ 'title' => 'Upload Directory',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => '',
+ ),
'imageUploadDir' => array(
- 'group_name' => 'Directory Preferences',
- 'group' => 'directory',
- 'name' => 'imageUploadDir',
- 'type' => 'Url',
- 'html_type' => 'Text',
- 'default' => '',
- 'add' => '4.1',
- 'prefetch' => 1,
- 'title' => 'Image Directory',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => '',
- 'help_text' => '',
- ),
+ 'group_name' => 'Directory Preferences',
+ 'group' => 'directory',
+ 'name' => 'imageUploadDir',
+ 'type' => 'Url',
+ 'html_type' => 'Text',
+ 'default' => '',
+ 'add' => '4.1',
+ 'prefetch' => 1,
+ 'title' => 'Image Directory',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => '',
+ ),
'customFileUploadDir' => array(
- 'group_name' => 'Directory Preferences',
- 'group' => 'directory',
- 'name' => 'customFileUploadDir',
- 'type' => 'Url',
- 'html_type' => 'Text',
- 'default' => '',
- 'add' => '4.1',
- 'prefetch' => 1,
- 'title' => 'Custom Files Upload Directory',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => '',
- 'help_text' => '',
- ),
+ 'group_name' => 'Directory Preferences',
+ 'group' => 'directory',
+ 'name' => 'customFileUploadDir',
+ 'type' => 'Url',
+ 'html_type' => 'Text',
+ 'default' => '',
+ 'add' => '4.1',
+ 'prefetch' => 1,
+ 'title' => 'Custom Files Upload Directory',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => '',
+ ),
'customTemplateDir' => array(
- 'group_name' => 'Directory Preferences',
- 'group' => 'directory',
- 'name' => 'customTemplateDir',
- 'type' => 'Url',
- 'html_type' => 'Text',
- 'default' => '',
- 'add' => '4.1',
- 'prefetch' => 1,
- 'title' => 'Custom Template Directory',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => '',
- 'help_text' => '',
- ),
+ 'group_name' => 'Directory Preferences',
+ 'group' => 'directory',
+ 'name' => 'customTemplateDir',
+ 'type' => 'Url',
+ 'html_type' => 'Text',
+ 'default' => '',
+ 'add' => '4.1',
+ 'prefetch' => 1,
+ 'title' => 'Custom Template Directory',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => '',
+ ),
'customPHPPathDir' => array(
- 'group_name' => 'Directory Preferences',
- 'group' => 'directory',
- 'name' => 'customPHPPathDir',
- 'type' => 'Url',
- 'html_type' => 'Text',
- 'default' => '',
- 'add' => '4.1',
- 'prefetch' => 1,
- 'title' => 'Custom PHP Path',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => '',
- 'help_text' => '',
- ),
+ 'group_name' => 'Directory Preferences',
+ 'group' => 'directory',
+ 'name' => 'customPHPPathDir',
+ 'type' => 'Url',
+ 'html_type' => 'Text',
+ 'default' => '',
+ 'add' => '4.1',
+ 'prefetch' => 1,
+ 'title' => 'Custom PHP Path',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => '',
+ ),
'extensionsDir' => array(
- 'group_name' => 'Directory Preferences',
- 'group' => 'directory',
- 'name' => 'extensionsDir',
- 'type' => 'Url',
- 'html_type' => 'Text',
- 'default' => '',
- 'add' => '4.1',
- 'prefetch' => 1,
- 'title' => 'Extensions Directory',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => '',
- 'help_text' => '',
- ),
+ 'group_name' => 'Directory Preferences',
+ 'group' => 'directory',
+ 'name' => 'extensionsDir',
+ 'type' => 'Url',
+ 'html_type' => 'Text',
+ 'default' => '',
+ 'add' => '4.1',
+ 'prefetch' => 1,
+ 'title' => 'Extensions Directory',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => '',
+ ),
'event_enable_cart' => array(
- 'name' => 'enable_cart',
- 'group_name' => 'Event Preferences',
- 'group' => 'event',
- 'type' => 'String',
- 'quick_form_type' => 'Element',
- 'default' => 0,
- 'add' => '4.1',
- 'title' => 'Enable Event Cart',
- 'is_domain' => 1,
- 'is_contact' => 1,
- 'description' => 'WRITE ME',
- 'help_text' => 'WRITE ME',
- ),
+ 'name' => 'enable_cart',
+ 'group_name' => 'Event Preferences',
+ 'group' => 'event',
+ 'type' => 'String',
+ 'quick_form_type' => 'Element',
+ 'default' => 0,
+ 'add' => '4.1',
+ 'title' => 'Enable Event Cart',
+ 'is_domain' => 1,
+ 'is_contact' => 1,
+ 'description' => 'WRITE ME',
+ 'help_text' => 'WRITE ME',
+ ),
'monetaryThousandSeparator' => array(
- 'group_name' => 'Localization Preferences',
- 'group' => 'localization',
- 'name' => 'monetaryThousandSeparator',
- 'prefetch' => 1,
- 'config_only' => 1,
- 'type' => 'String',
- 'quick_form_type' => 'Element',
- 'html_type' => 'text',
- 'html_attributes' => array(
- 'size' => 2,
- ),
- 'default' => ',',
- 'add' => '4.3',
- 'title' => 'Thousands Separator',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => '',
- 'help_text' => '',
- ),
+ 'group_name' => 'Localization Preferences',
+ 'group' => 'localization',
+ 'name' => 'monetaryThousandSeparator',
+ 'prefetch' => 1,
+ 'config_only' => 1,
+ 'type' => 'String',
+ 'quick_form_type' => 'Element',
+ 'html_type' => 'text',
+ 'html_attributes' => array(
+ 'size' => 2,
+ ),
+ 'default' => ',',
+ 'add' => '4.3',
+ 'title' => 'Thousands Separator',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => '',
+ ),
'monetaryDecimalPoint' => array(
- 'group_name' => 'Localization Preferences',
- 'group' => 'localization',
- 'name' => 'monetaryDecimalPoint',
- 'prefetch' => 1,
- 'config_only' => 1,
- 'type' => 'String',
- 'quick_form_type' => 'Element',
- 'html_type' => 'text',
- 'html_attributes' => array(
- 'size' => 2,
- ),
- 'default' => '.',
- 'add' => '4.3',
- 'title' => 'Decimal Delimiter',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => '',
- 'help_text' => '',
- ),
+ 'group_name' => 'Localization Preferences',
+ 'group' => 'localization',
+ 'name' => 'monetaryDecimalPoint',
+ 'prefetch' => 1,
+ 'config_only' => 1,
+ 'type' => 'String',
+ 'quick_form_type' => 'Element',
+ 'html_type' => 'text',
+ 'html_attributes' => array(
+ 'size' => 2,
+ ),
+ 'default' => '.',
+ 'add' => '4.3',
+ 'title' => 'Decimal Delimiter',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => '',
+ ),
'moneyformat' => array(
- 'group_name' => 'Localization Preferences',
- 'group' => 'localization',
- 'name' => 'moneyformat',
- 'prefetch' => 1,
- 'config_only' => 1,
- 'type' => 'String',
- 'quick_form_type' => 'Element',
- 'html_type' => 'text',
- 'default' => '%c %a',
- 'add' => '4.3',
- 'title' => 'Monetary Amount Display',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => '',
- 'help_text' => '',
- ),
+ 'group_name' => 'Localization Preferences',
+ 'group' => 'localization',
+ 'name' => 'moneyformat',
+ 'prefetch' => 1,
+ 'config_only' => 1,
+ 'type' => 'String',
+ 'quick_form_type' => 'Element',
+ 'html_type' => 'text',
+ 'default' => '%c %a',
+ 'add' => '4.3',
+ 'title' => 'Monetary Amount Display',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => '',
+ ),
'moneyvalueformat' => array(
- 'group_name' => 'Localization Preferences',
- 'group' => 'localization',
- 'name' => 'moneyvalueformat',
- 'prefetch' => 1,
- 'config_only' => 1,
- 'type' => 'String',
- 'quick_form_type' => 'Element',
- 'html_type' => 'text',
- 'default' => '%!i',
- 'add' => '4.3',
- 'title' => 'Monetary Amount Display',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => '',
- 'help_text' => '',
- ),
+ 'group_name' => 'Localization Preferences',
+ 'group' => 'localization',
+ 'name' => 'moneyvalueformat',
+ 'prefetch' => 1,
+ 'config_only' => 1,
+ 'type' => 'String',
+ 'quick_form_type' => 'Element',
+ 'html_type' => 'text',
+ 'default' => '%!i',
+ 'add' => '4.3',
+ 'title' => 'Monetary Amount Display',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => '',
+ ),
'defaultCurrency' => array(
- 'group_name' => 'Localization Preferences',
- 'group' => 'localization',
- 'name' => 'defaultCurrency',
- 'prefetch' => 1,
- 'config_only' => 1,
- 'type' => 'String',
- 'quick_form_type' => 'Element',
- 'html_type' => 'text',
- 'html_attributes' => array(
- 'size' => 2,
- ),
- 'default' => 'USD',
- 'add' => '4.3',
- 'title' => 'Default Currency',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => 'Default currency assigned to contributions and other monetary transactions.',
- 'help_text' => '',
- ),
+ 'group_name' => 'Localization Preferences',
+ 'group' => 'localization',
+ 'name' => 'defaultCurrency',
+ 'prefetch' => 1,
+ 'config_only' => 1,
+ 'type' => 'String',
+ 'quick_form_type' => 'Element',
+ 'html_type' => 'text',
+ 'html_attributes' => array(
+ 'size' => 2,
+ ),
+ 'default' => 'USD',
+ 'add' => '4.3',
+ 'title' => 'Default Currency',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => 'Default currency assigned to contributions and other monetary transactions.',
+ 'help_text' => '',
+ ),
'defaultContactCountry' => array(
- 'group_name' => 'Localization Preferences',
- 'group' => 'localization',
- 'name' => 'defaultContactCountry',
- 'prefetch' => 1,
- 'config_only' => 1,
- 'type' => 'String',
- 'quick_form_type' => 'Element',
- 'html_type' => 'text',
- 'html_attributes' => array(
- 'size' => 4,
- ),
- 'default' => '1228',
- 'add' => '4.4',
- 'title' => 'Default Country',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => 'This value is selected by default when adding a new contact address.',
- 'help_text' => '',
- ),
+ 'group_name' => 'Localization Preferences',
+ 'group' => 'localization',
+ 'name' => 'defaultContactCountry',
+ 'prefetch' => 1,
+ 'config_only' => 1,
+ 'type' => 'String',
+ 'quick_form_type' => 'Element',
+ 'html_type' => 'text',
+ 'html_attributes' => array(
+ 'size' => 4,
+ ),
+ 'default' => '1228',
+ 'add' => '4.4',
+ 'title' => 'Default Country',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => 'This value is selected by default when adding a new contact address.',
+ 'help_text' => '',
+ ),
'countryLimit' => array(
- 'group_name' => 'Localization Preferences',
- 'group' => 'localization',
- 'name' => 'countryLimit',
- 'prefetch' => 1,
- 'config_only' => 1,
- 'type' => 'Array',
- 'quick_form_type' => 'Element',
- 'html_type' => 'advmultiselect',
- 'html_attributes' => array(
- 'size' => 5,
- 'style' => 'width:150px',
- 'class' => 'advmultiselect',
- ),
- 'default' => 'null',
- 'add' => '4.3',
- 'title' => 'Available Countries',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => '',
- 'help_text' => '',
- ),
+ 'group_name' => 'Localization Preferences',
+ 'group' => 'localization',
+ 'name' => 'countryLimit',
+ 'prefetch' => 1,
+ 'config_only' => 1,
+ 'type' => 'Array',
+ 'quick_form_type' => 'Element',
+ 'html_type' => 'advmultiselect',
+ 'html_attributes' => array(
+ 'size' => 5,
+ 'style' => 'width:150px',
+ 'class' => 'advmultiselect',
+ ),
+ 'default' => 'null',
+ 'add' => '4.3',
+ 'title' => 'Available Countries',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => '',
+ ),
'provinceLimit' => array(
- 'group_name' => 'Localization Preferences',
- 'group' => 'localization',
- 'name' => 'provinceLimit',
- 'prefetch' => 1,
- 'config_only' => 1,
- 'type' => 'Array',
- 'quick_form_type' => 'Element',
- 'html_type' => 'advmultiselect',
- 'html_attributes' => array(
- 'size' => 5,
- 'style' => 'width:150px',
- 'class' => 'advmultiselect',
- ),
- 'default' => 'null',
- 'add' => '4.3',
- 'title' => 'Available States and Provinces',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => '',
- 'help_text' => '',
- ),
+ 'group_name' => 'Localization Preferences',
+ 'group' => 'localization',
+ 'name' => 'provinceLimit',
+ 'prefetch' => 1,
+ 'config_only' => 1,
+ 'type' => 'Array',
+ 'quick_form_type' => 'Element',
+ 'html_type' => 'advmultiselect',
+ 'html_attributes' => array(
+ 'size' => 5,
+ 'style' => 'width:150px',
+ 'class' => 'advmultiselect',
+ ),
+ 'default' => 'null',
+ 'add' => '4.3',
+ 'title' => 'Available States and Provinces',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => '',
+ ),
'inheritLocale' => array(
- 'group_name' => 'Localization Preferences',
- 'group' => 'localization',
- 'name' => 'inheritLocale',
- 'prefetch' => 1,
- 'config_only' => 1,
- 'type' => 'Boolean',
- 'quick_form_type' => 'YesNo',
- 'default' => 0,
- 'add' => '4.3',
- 'title' => 'Inherit CMS Language',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => '',
- 'help_text' => '',
- ),
+ 'group_name' => 'Localization Preferences',
+ 'group' => 'localization',
+ 'name' => 'inheritLocale',
+ 'prefetch' => 1,
+ 'config_only' => 1,
+ 'type' => 'Boolean',
+ 'quick_form_type' => 'YesNo',
+ 'default' => 0,
+ 'add' => '4.3',
+ 'title' => 'Inherit CMS Language',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => '',
+ ),
'dateformatDatetime' => array(
- 'group_name' => 'Localization Preferences',
- 'group' => 'localization',
- 'name' => 'dateformatDatetime',
- 'prefetch' => 1,
- 'config_only' => 1,
- 'type' => 'String',
- 'default' => '%B %E%f, %Y %l:%M %P',
- 'add' => '4.3',
- 'title' => 'Complete Date and Time',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => '',
- 'help_text' => '',
- ),
+ 'group_name' => 'Localization Preferences',
+ 'group' => 'localization',
+ 'name' => 'dateformatDatetime',
+ 'prefetch' => 1,
+ 'config_only' => 1,
+ 'type' => 'String',
+ 'default' => '%B %E%f, %Y %l:%M %P',
+ 'add' => '4.3',
+ 'title' => 'Complete Date and Time',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => '',
+ ),
'dateformatFull' => array(
- 'group_name' => 'Localization Preferences',
- 'group' => 'localization',
- 'name' => 'dateformatFull',
- 'prefetch' => 1,
- 'config_only' => 1,
- 'type' => 'String',
- 'default' => '%B %E%f, %Y',
- 'add' => '4.3',
- 'title' => 'Complete Date',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => '',
- 'help_text' => '',
- ),
+ 'group_name' => 'Localization Preferences',
+ 'group' => 'localization',
+ 'name' => 'dateformatFull',
+ 'prefetch' => 1,
+ 'config_only' => 1,
+ 'type' => 'String',
+ 'default' => '%B %E%f, %Y',
+ 'add' => '4.3',
+ 'title' => 'Complete Date',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => '',
+ ),
'dateformatPartial' => array(
- 'group_name' => 'Localization Preferences',
- 'group' => 'localization',
- 'name' => 'dateformatPartial',
- 'prefetch' => 1,
- 'config_only' => 1,
- 'type' => 'String',
- 'default' => '%B %Y',
- 'add' => '4.3',
- 'title' => 'Month and Year',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => '',
- 'help_text' => '',
- ),
+ 'group_name' => 'Localization Preferences',
+ 'group' => 'localization',
+ 'name' => 'dateformatPartial',
+ 'prefetch' => 1,
+ 'config_only' => 1,
+ 'type' => 'String',
+ 'default' => '%B %Y',
+ 'add' => '4.3',
+ 'title' => 'Month and Year',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => '',
+ ),
'lcMessages' => array(
- 'group_name' => 'Localization Preferences',
- 'group' => 'localization',
- 'name' => 'lcMessages',
- 'prefetch' => 1,
- 'config_only' => 1,
- 'type' => 'String',
- 'default' => 'en_US',
- 'add' => '4.3',
- 'title' => 'Default Language',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => '',
- 'help_text' => '',
- ),
+ 'group_name' => 'Localization Preferences',
+ 'group' => 'localization',
+ 'name' => 'lcMessages',
+ 'prefetch' => 1,
+ 'config_only' => 1,
+ 'type' => 'String',
+ 'default' => 'en_US',
+ 'add' => '4.3',
+ 'title' => 'Default Language',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => '',
+ ),
'profile_double_optin' => array(
- 'group_name' => 'Mailing Preferences',
- 'group' => 'mailing',
- 'name' => 'profile_double_optin',
- 'type' => 'Integer',
- 'html_type' => 'checkbox',
- 'default' => 0,
- 'add' => '4.1',
- 'title' => 'Enable Double Opt-in for Profile Group(s) field',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => 'When CiviMail is enabled, users who \"subscribe\" to a group from a profile Group(s) checkbox will receive a confirmation email. They must respond (opt-in) before they are added to the group.',
- 'help_text' => '',
- ),
+ 'group_name' => 'Mailing Preferences',
+ 'group' => 'mailing',
+ 'name' => 'profile_double_optin',
+ 'type' => 'Integer',
+ 'html_type' => 'checkbox',
+ 'default' => 0,
+ 'add' => '4.1',
+ 'title' => 'Enable Double Opt-in for Profile Group(s) field',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => 'When CiviMail is enabled, users who \"subscribe\" to a group from a profile Group(s) checkbox will receive a confirmation email. They must respond (opt-in) before they are added to the group.',
+ 'help_text' => '',
+ ),
'track_civimail_replies' => array(
- 'group_name' => 'Mailing Preferences',
- 'group' => 'mailing',
- 'name' => 'track_civimail_replies',
- 'type' => 'Integer',
- 'html_type' => 'checkbox',
- 'default' => 0,
- 'add' => '4.1',
- 'title' => 'Enable Double Opt-in for Profile Group(s) field',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => 'When CiviMail is enabled, users who \"subscribe\" to a group from a profile Group(s) checkbox will receive a confirmation email. They must respond (opt-in) before they are added to the group.',
- 'help_text' => '',
- 'validate_callback' => 'CRM_Core_BAO_Setting::validateBoolSetting',
- ),
+ 'group_name' => 'Mailing Preferences',
+ 'group' => 'mailing',
+ 'name' => 'track_civimail_replies',
+ 'type' => 'Integer',
+ 'html_type' => 'checkbox',
+ 'default' => 0,
+ 'add' => '4.1',
+ 'title' => 'Enable Double Opt-in for Profile Group(s) field',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => 'When CiviMail is enabled, users who \"subscribe\" to a group from a profile Group(s) checkbox will receive a confirmation email. They must respond (opt-in) before they are added to the group.',
+ 'help_text' => '',
+ 'validate_callback' => 'CRM_Core_BAO_Setting::validateBoolSetting',
+ ),
'civimail_workflow' => array(
- 'group_name' => 'Mailing Preferences',
- 'group' => 'mailing',
- 'name' => 'civimail_workflow',
- 'type' => 'Integer',
- 'html_type' => 'checkbox',
- 'default' => 0,
- 'add' => '4.1',
- 'title' => 'Use CiviMail Workflow',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => 'When CiviMail is enabled, users who \"subscribe\" to a group from a profile Group(s) checkbox will receive a confirmation email. They must respond (opt-in) before they are added to the group.',
- 'help_text' => '',
- ),
+ 'group_name' => 'Mailing Preferences',
+ 'group' => 'mailing',
+ 'name' => 'civimail_workflow',
+ 'type' => 'Integer',
+ 'html_type' => 'checkbox',
+ 'default' => 0,
+ 'add' => '4.1',
+ 'title' => 'Use CiviMail Workflow',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => 'When CiviMail is enabled, users who \"subscribe\" to a group from a profile Group(s) checkbox will receive a confirmation email. They must respond (opt-in) before they are added to the group.',
+ 'help_text' => '',
+ ),
'civimail_server_wide_lock' => array(
- 'group_name' => 'Mailing Preferences',
- 'group' => 'mailing',
- 'name' => 'civimail_server_wide_lock',
- 'type' => 'Integer',
- 'html_type' => 'checkbox',
- 'default' => 0,
- 'add' => '4.1',
- 'title' => 'Lock Mails Server-Wide for Mail Sending',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => '',
- 'help_text' => '',
- ),
+ 'group_name' => 'Mailing Preferences',
+ 'group' => 'mailing',
+ 'name' => 'civimail_server_wide_lock',
+ 'type' => 'Integer',
+ 'html_type' => 'checkbox',
+ 'default' => 0,
+ 'add' => '4.1',
+ 'title' => 'Lock Mails Server-Wide for Mail Sending',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => '',
+ ),
'mailing_backend' => array(
- 'group_name' => 'Mailing Preferences',
- 'group' => 'mailing',
- 'name' => 'mailing_backend',
- 'type' => 'Array',
- 'html_type' => 'checkbox',
- 'default' => 0,
- 'add' => '4.1',
- 'title' => 'Mailing Backend',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => '',
- 'help_text' => '',
- ),
+ 'group_name' => 'Mailing Preferences',
+ 'group' => 'mailing',
+ 'name' => 'mailing_backend',
+ 'type' => 'Array',
+ 'html_type' => 'checkbox',
+ 'default' => 0,
+ 'add' => '4.1',
+ 'title' => 'Mailing Backend',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => '',
+ ),
'profile_add_to_group_double_optin' => array(
- 'group_name' => 'Mailing Preferences',
- 'group' => 'mailing',
- 'name' => 'profile_add_to_group_double_optin',
- 'type' => 'Integer',
- 'html_type' => 'checkbox',
- 'default' => 0,
- 'add' => '4.1',
- 'title' => 'Enable Double Opt-in for Profile Group(s) field',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => 'When CiviMail is enabled, users who \"subscribe\" to a group from a profile Group(s) checkbox will receive a confirmation email. They must respond (opt-in) before they are added to the group.',
- 'help_text' => '',
- ),
+ 'group_name' => 'Mailing Preferences',
+ 'group' => 'mailing',
+ 'name' => 'profile_add_to_group_double_optin',
+ 'type' => 'Integer',
+ 'html_type' => 'checkbox',
+ 'default' => 0,
+ 'add' => '4.1',
+ 'title' => 'Enable Double Opt-in for Profile Group(s) field',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => 'When CiviMail is enabled, users who \"subscribe\" to a group from a profile Group(s) checkbox will receive a confirmation email. They must respond (opt-in) before they are added to the group.',
+ 'help_text' => '',
+ ),
'disable_mandatory_tokens_check' => array(
- 'group_name' => 'Mailing Preferences',
- 'group' => 'mailing',
- 'name' => 'disable_mandatory_tokens_check',
- 'type' => 'Integer',
- 'html_type' => 'checkbox',
- 'default' => 0,
- 'add' => '4.4',
- 'title' => 'Disable check for mandatory tokens',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => 'Don\'t check for presence of mandatory tokens (domain address; unsubscribe/opt-out) before sending mailings. WARNING: Mandatory tokens are a safe-guard which facilitate compliance with the US CAN-SPAM Act. They should only be disabled if your organization adopts other mechanisms for compliance or if your organization is not subject to CAN-SPAM.',
- 'help_text' => '',
- ),
+ 'group_name' => 'Mailing Preferences',
+ 'group' => 'mailing',
+ 'name' => 'disable_mandatory_tokens_check',
+ 'type' => 'Integer',
+ 'html_type' => 'checkbox',
+ 'default' => 0,
+ 'add' => '4.4',
+ 'title' => 'Disable check for mandatory tokens',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => 'Don\'t check for presence of mandatory tokens (domain address; unsubscribe/opt-out) before sending mailings. WARNING: Mandatory tokens are a safe-guard which facilitate compliance with the US CAN-SPAM Act. They should only be disabled if your organization adopts other mechanisms for compliance or if your organization is not subject to CAN-SPAM.',
+ 'help_text' => '',
+ ),
'dedupe_email_default' => array(
- 'group_name' => 'Mailing Preferences',
- 'group' => 'mailing',
- 'name' => 'dedupe_email_default',
- 'type' => 'Integer',
- 'html_type' => 'checkbox',
- 'default' => 1,
- 'add' => '4.5',
- 'title' => 'CiviMail dedupes e-mail addresses by default',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => 'Set the \"dedupe e-mail\" option when sending a new mailing to \"true\" by default.',
- 'help_text' => '',
- ),
+ 'group_name' => 'Mailing Preferences',
+ 'group' => 'mailing',
+ 'name' => 'dedupe_email_default',
+ 'type' => 'Integer',
+ 'html_type' => 'checkbox',
+ 'default' => 1,
+ 'add' => '4.5',
+ 'title' => 'CiviMail dedupes e-mail addresses by default',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => 'Set the \"dedupe e-mail\" option when sending a new mailing to \"true\" by default.',
+ 'help_text' => '',
+ ),
'hash_mailing_url' => array(
- 'group_name' => 'Mailing Preferences',
- 'group' => 'mailing',
- 'name' => 'hash_mailing_url',
- 'type' => 'Integer',
- 'html_type' => 'checkbox',
- 'default' => 0,
- 'add' => '4.5',
- 'title' => 'Hashed Mailing URL\'s',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => 'If enabled, a randomized hash key will be used to reference the mailing URL in the mailing.viewUrl token, instead of the mailing ID',
- 'help_text' => '',
- ),
+ 'group_name' => 'Mailing Preferences',
+ 'group' => 'mailing',
+ 'name' => 'hash_mailing_url',
+ 'type' => 'Integer',
+ 'html_type' => 'checkbox',
+ 'default' => 0,
+ 'add' => '4.5',
+ 'title' => 'Hashed Mailing URL\'s',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => 'If enabled, a randomized hash key will be used to reference the mailing URL in the mailing.viewUrl token, instead of the mailing ID',
+ 'help_text' => '',
+ ),
'default_renewal_contribution_page' => array(
- 'group_name' => 'Member Preferences',
- 'group' => 'member',
- 'name' => 'default_renewal_contribution_page',
- 'type' => 'Integer',
- 'html_type' => 'Select',
- 'default' => '',
- 'pseudoconstant' => array(
- 'name' => 'contributionPage',
- ),
- 'add' => '4.1',
- 'title' => 'Default online membership renewal page',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => 'If you select a default online contribution page for self-service membership renewals, a \"renew\" link pointing to that page will be displayed on the Contact Dashboard for memberships which were entered offline. You will need to ensure that the membership block for the selected online contribution page includes any currently available memberships.',
- 'help_text' => '',
- ),
+ 'group_name' => 'Member Preferences',
+ 'group' => 'member',
+ 'name' => 'default_renewal_contribution_page',
+ 'type' => 'Integer',
+ 'html_type' => 'Select',
+ 'default' => '',
+ 'pseudoconstant' => array(
+ 'name' => 'contributionPage',
+ ),
+ 'add' => '4.1',
+ 'title' => 'Default online membership renewal page',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => 'If you select a default online contribution page for self-service membership renewals, a \"renew\" link pointing to that page will be displayed on the Contact Dashboard for memberships which were entered offline. You will need to ensure that the membership block for the selected online contribution page includes any currently available memberships.',
+ 'help_text' => '',
+ ),
'is_enabled' => array(
- 'group_name' => 'Multi Site Preferences',
- 'group' => 'multisite',
- 'name' => 'is_enabled',
- 'title' => 'Multisite Is enabled',
- 'type' => 'Integer',
- 'default' => '',
- 'add' => '4.1',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => 'Multisite is enabled',
- 'help_text' => '',
- ),
+ 'group_name' => 'Multi Site Preferences',
+ 'group' => 'multisite',
+ 'name' => 'is_enabled',
+ 'title' => 'Multisite Is enabled',
+ 'type' => 'Integer',
+ 'default' => '',
+ 'add' => '4.1',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => 'Multisite is enabled',
+ 'help_text' => '',
+ ),
'domain_group_id' => array(
- 'group_name' => 'Multi Site Preferences',
- 'group' => 'multisite',
- 'name' => 'domain_group_id',
- 'title' => 'Multisite Domain Group',
- 'type' => 'Integer',
- 'default' => '',
- 'add' => '4.1',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => '',
- 'help_text' => '',
- ),
+ 'group_name' => 'Multi Site Preferences',
+ 'group' => 'multisite',
+ 'name' => 'domain_group_id',
+ 'title' => 'Multisite Domain Group',
+ 'type' => 'Integer',
+ 'default' => '',
+ 'add' => '4.1',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => '',
+ ),
'event_price_set_domain_id' => array(
- 'group_name' => 'Multi Site Preferences',
- 'group' => 'multisite',
- 'name' => 'event_price_set_domain_id',
- 'title' => 'Domain Event Price Set',
- 'type' => 'Integer',
- 'default' => '',
- 'add' => '4.1',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => '',
- 'help_text' => '',
- ),
+ 'group_name' => 'Multi Site Preferences',
+ 'group' => 'multisite',
+ 'name' => 'event_price_set_domain_id',
+ 'title' => 'Domain Event Price Set',
+ 'type' => 'Integer',
+ 'default' => '',
+ 'add' => '4.1',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => '',
+ ),
'uniq_email_per_site' => array(
- 'group_name' => 'Multi Site Preferences',
- 'group' => 'multisite',
- 'name' => 'uniq_email_per_site',
- 'type' => 'Integer',
- 'title' => 'Unique Email per Domain?',
- 'default' => '',
- 'add' => '4.1',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => '',
- 'help_text' => '',
- ),
+ 'group_name' => 'Multi Site Preferences',
+ 'group' => 'multisite',
+ 'name' => 'uniq_email_per_site',
+ 'type' => 'Integer',
+ 'title' => 'Unique Email per Domain?',
+ 'default' => '',
+ 'add' => '4.1',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => '',
+ ),
'search_autocomplete_count' => array(
- 'group_name' => 'Search Preferences',
- 'group' => 'Search Preferences',
- 'name' => 'search_autocomplete_count',
- 'prefetch' => 0,
- 'type' => 'Integer',
- 'quick_form_type' => 'Element',
- 'html_type' => 'text',
- 'html_attributes' => array(
- 'size' => 2,
- 'maxlength' => 2,
- ),
- 'default' => 10,
- 'add' => '4.3',
- 'title' => 'Autocomplete Results',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => 'The maximum number of contacts to show at a time when typing in an autocomplete field.',
- 'help_text' => '',
- ),
+ 'group_name' => 'Search Preferences',
+ 'group' => 'Search Preferences',
+ 'name' => 'search_autocomplete_count',
+ 'prefetch' => 0,
+ 'type' => 'Integer',
+ 'quick_form_type' => 'Element',
+ 'html_type' => 'text',
+ 'html_attributes' => array(
+ 'size' => 2,
+ 'maxlength' => 2,
+ ),
+ 'default' => 10,
+ 'add' => '4.3',
+ 'title' => 'Autocomplete Results',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => 'The maximum number of contacts to show at a time when typing in an autocomplete field.',
+ 'help_text' => '',
+ ),
'enable_innodb_fts' => array(
- 'group_name' => 'Search Preferences',
- 'group' => 'Search Preferences',
- 'name' => 'enable_innodb_fts',
- 'prefetch' => 0,
- 'type' => 'Boolean',
- 'quick_form_type' => 'YesNo',
- 'default' => 0,
- 'add' => '4.4',
- 'title' => 'InnoDB Full Text Search',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => 'Enable InnoDB full-text search optimizations. (Requires MySQL 5.6+)',
- 'help_text' => '',
- 'on_change' => array(
- '0' => array(
- '0' => 'CRM_Core_InnoDBIndexer',
- '1' => 'onToggleFts',
- ),
- ),
- ),
+ 'group_name' => 'Search Preferences',
+ 'group' => 'Search Preferences',
+ 'name' => 'enable_innodb_fts',
+ 'prefetch' => 0,
+ 'type' => 'Boolean',
+ 'quick_form_type' => 'YesNo',
+ 'default' => 0,
+ 'add' => '4.4',
+ 'title' => 'InnoDB Full Text Search',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => 'Enable InnoDB full-text search optimizations. (Requires MySQL 5.6+)',
+ 'help_text' => '',
+ 'on_change' => array(
+ '0' => array(
+ '0' => 'CRM_Core_InnoDBIndexer',
+ '1' => 'onToggleFts',
+ ),
+ ),
+ ),
'fts_query_mode' => array(
- 'group_name' => 'Search Preferences',
- 'group' => 'Search Preferences',
- 'name' => 'fts_query_mode',
- 'prefetch' => 0,
- 'type' => 'String',
- 'quick_form_type' => 'Element',
- 'html_type' => 'Text',
- 'html_attributes' => array(
- 'size' => 64,
- 'maxlength' => 64,
- ),
- 'default' => 'simple',
- 'add' => '4.5',
- 'title' => 'How to handle full-tet queries',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => '',
- 'help_text' => '',
- ),
+ 'group_name' => 'Search Preferences',
+ 'group' => 'Search Preferences',
+ 'name' => 'fts_query_mode',
+ 'prefetch' => 0,
+ 'type' => 'String',
+ 'quick_form_type' => 'Element',
+ 'html_type' => 'Text',
+ 'html_attributes' => array(
+ 'size' => 64,
+ 'maxlength' => 64,
+ ),
+ 'default' => 'simple',
+ 'add' => '4.5',
+ 'title' => 'How to handle full-tet queries',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => '',
+ 'help_text' => '',
+ ),
'userFrameworkResourceURL' => array(
- 'group' => 'url',
- 'group_name' => 'URL Preferences',
- 'name' => 'userFrameworkResourceURL',
- 'title' => 'Script and CSS Resources URL',
- 'type' => 'String',
- 'default' => '',
- 'add' => '4.1',
- 'prefetch' => 1,
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => 'CiviCRM Resource URL',
- 'help_text' => '',
- 'validate_callback' => 'CRM_Utils_Rule::url',
- ),
+ 'group' => 'url',
+ 'group_name' => 'URL Preferences',
+ 'name' => 'userFrameworkResourceURL',
+ 'title' => 'Script and CSS Resources URL',
+ 'type' => 'String',
+ 'default' => '',
+ 'add' => '4.1',
+ 'prefetch' => 1,
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => 'CiviCRM Resource URL',
+ 'help_text' => '',
+ 'validate_callback' => 'CRM_Utils_Rule::url',
+ ),
'imageUploadURL' => array(
- 'group' => 'url',
- 'group_name' => 'URL Preferences',
- 'title' => 'Image URL Prefix',
- 'name' => 'imageUploadURL',
- 'type' => 'String',
- 'default' => '',
- 'add' => '4.1',
- 'prefetch' => 1,
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => 'Image Upload URL',
- 'help_text' => '',
- 'validate_callback' => 'CRM_Utils_Rule::url',
- ),
+ 'group' => 'url',
+ 'group_name' => 'URL Preferences',
+ 'title' => 'Image URL Prefix',
+ 'name' => 'imageUploadURL',
+ 'type' => 'String',
+ 'default' => '',
+ 'add' => '4.1',
+ 'prefetch' => 1,
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => 'Image Upload URL',
+ 'help_text' => '',
+ 'validate_callback' => 'CRM_Utils_Rule::url',
+ ),
'customCSSURL' => array(
- 'group' => 'url',
- 'group_name' => 'URL Preferences',
- 'name' => 'customCSSURL',
- 'title' => 'Custom CSS',
- 'type' => 'String',
- 'default' => '',
- 'add' => '4.1',
- 'prefetch' => 1,
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => 'Custom CiviCRM CSS URL',
- 'help_text' => '',
- 'validate_callback' => 'CRM_Utils_Rule::url',
- ),
+ 'group' => 'url',
+ 'group_name' => 'URL Preferences',
+ 'name' => 'customCSSURL',
+ 'title' => 'Custom CSS',
+ 'type' => 'String',
+ 'default' => '',
+ 'add' => '4.1',
+ 'prefetch' => 1,
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => 'Custom CiviCRM CSS URL',
+ 'help_text' => '',
+ 'validate_callback' => 'CRM_Utils_Rule::url',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetFields and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetFields
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/SettingTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using setting get API
- * shows getting a variable for a current domain *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function setting_get_example(){
-$params = array(
- 'return' => 'uniq_email_per_site',
-);
-try{
- $result = civicrm_api3('setting', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using setting get API.
+ *
+ * shows getting a variable for a current domain
+ *
+ * @return array
+ * API result array
+ */
+function setting_get_example() {
+ $params = array(
+ 'return' => 'uniq_email_per_site',
+ );
-return $result;
+ try{
+ $result = civicrm_api3('setting', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function setting_get_expectedresult(){
+function setting_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'uniq_email_per_site' => 0,
- ),
+ 'uniq_email_per_site' => 0,
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetSetting and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetSetting
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/SettingTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using setting Get API
- * shows getting a variable for specified domains *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function setting_get_example(){
-$params = array(
- 'domain_id' => array(
+
+/**
+ * Test Generated example of using setting Get API.
+ *
+ * shows getting a variable for specified domains
+ *
+ * @return array
+ * API result array
+ */
+function setting_get_example() {
+ $params = array(
+ 'domain_id' => array(
'0' => 1,
'1' => 2,
),
- 'return' => array(
+ 'return' => array(
'0' => 'uniq_email_per_site',
),
-);
+ );
-try{
- $result = civicrm_api3('setting', 'Get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+ try{
+ $result = civicrm_api3('setting', 'Get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
-return $result;
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function setting_get_expectedresult(){
+function setting_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 2,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 2,
+ 'values' => array(
'1' => array(
- 'uniq_email_per_site' => 0,
- ),
+ 'uniq_email_per_site' => 0,
+ ),
'2' => array(
- 'uniq_email_per_site' => '1',
- ),
+ 'uniq_email_per_site' => '1',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreateSettingMultipleDomains and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreateSettingMultipleDomains
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/SettingTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using setting getvalue API
- * Demonstrates getvalue action - intended for runtime use as better caching than get *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function setting_getvalue_example(){
-$params = array(
- 'name' => 'petition_contacts',
- 'group' => 'Campaign Preferences',
-);
-try{
- $result = civicrm_api3('setting', 'getvalue', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using setting getvalue API.
+ *
+ * Demonstrates getvalue action - intended for runtime use as better caching than get
+ *
+ * @return array
+ * API result array
+ */
+function setting_getvalue_example() {
+ $params = array(
+ 'name' => 'petition_contacts',
+ 'group' => 'Campaign Preferences',
+ );
-return $result;
+ try{
+ $result = civicrm_api3('setting', 'getvalue', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function setting_getvalue_expectedresult(){
+function setting_getvalue_expectedresult() {
$expectedResult = 'Petition Contacts';
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetValue and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetValue
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/SettingTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using setting revert API
- * Demonstrates reverting a parameter to default value *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function setting_revert_example(){
-$params = array(
- 'name' => 'address_format',
-);
-try{
- $result = civicrm_api3('setting', 'revert', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using setting revert API.
+ *
+ * Demonstrates reverting a parameter to default value
+ *
+ * @return array
+ * API result array
+ */
+function setting_revert_example() {
+ $params = array(
+ 'name' => 'address_format',
+ );
-return $result;
+ try{
+ $result = civicrm_api3('setting', 'revert', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function setting_revert_expectedresult(){
+function setting_revert_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 5,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 5,
+ 'id' => 1,
+ 'values' => array(
'is_error' => 0,
'version' => 3,
'count' => 1,
'id' => 1,
'values' => array(
- '1' => array(
- 'address_format' => '{contact.address_name}
+ '1' => array(
+ 'address_format' => '{contact.address_name}
{contact.street_address}
{contact.supplemental_address_1}
{contact.supplemental_address_2}
{contact.city}{, }{contact.state_province}{ }{contact.postal_code}
{contact.country}',
- ),
),
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testRevert and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testRevert
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/SettingTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using survey get API
- * demonstrates get + delete in the same call *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function survey_get_example(){
-$params = array(
- 'title' => 'survey title',
- 'api.survey.delete' => 1,
-);
-try{
- $result = civicrm_api3('survey', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using survey get API.
+ *
+ * demonstrates get + delete in the same call
+ *
+ * @return array
+ * API result array
+ */
+function survey_get_example() {
+ $params = array(
+ 'title' => 'survey title',
+ 'api.survey.delete' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('survey', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function survey_get_expectedresult(){
+function survey_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
- '1' => array(
- 'id' => '1',
- 'title' => 'survey title',
- 'activity_type_id' => '30',
- 'instructions' => 'Call people, ask for money',
- 'max_number_of_contacts' => '12',
- 'is_active' => '1',
- 'is_default' => 0,
- 'created_date' => '2013-07-28 08:49:19',
- 'bypass_confirm' => 0,
- 'is_share' => '1',
- 'api.survey.delete' => array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'values' => true,
- ),
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 4,
+ 'values' => array(
+ '4' => array(
+ 'id' => '4',
+ 'title' => 'survey title',
+ 'activity_type_id' => '30',
+ 'instructions' => 'Call people, ask for money',
+ 'max_number_of_contacts' => '12',
+ 'is_active' => '1',
+ 'is_default' => 0,
+ 'created_date' => '2013-07-28 08:49:19',
+ 'bypass_confirm' => 0,
+ 'is_share' => '1',
+ 'api.survey.delete' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'values' => TRUE,
),
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetSurveyChainDelete and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetSurveyChainDelete
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/SurveyTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using survey create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function survey_create_example(){
-$params = array(
- 'title' => 'survey title',
- 'activity_type_id' => '30',
- 'max_number_of_contacts' => 12,
- 'instructions' => 'Call people, ask for money',
-);
-try{
- $result = civicrm_api3('survey', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using survey create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function survey_create_example() {
+ $params = array(
+ 'title' => 'survey title',
+ 'activity_type_id' => '30',
+ 'max_number_of_contacts' => 12,
+ 'instructions' => 'Call people, ask for money',
+ );
-return $result;
+ try{
+ $result = civicrm_api3('survey', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function survey_create_expectedresult(){
+function survey_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'title' => 'survey title',
- 'campaign_id' => '',
- 'activity_type_id' => '30',
- 'recontact_interval' => '',
- 'instructions' => 'Call people, ask for money',
- 'release_frequency' => '',
- 'max_number_of_contacts' => '12',
- 'default_number_of_contacts' => '',
- 'is_active' => '',
- 'is_default' => '',
- 'created_id' => '',
- 'created_date' => '2013-07-28 08:49:19',
- 'last_modified_id' => '',
- 'last_modified_date' => '',
- 'result_id' => '',
- 'bypass_confirm' => '',
- 'thankyou_title' => '',
- 'thankyou_text' => '',
- 'is_share' => '',
- ),
+ 'id' => '1',
+ 'title' => 'survey title',
+ 'campaign_id' => '',
+ 'activity_type_id' => '30',
+ 'recontact_interval' => '',
+ 'instructions' => 'Call people, ask for money',
+ 'release_frequency' => '',
+ 'max_number_of_contacts' => '12',
+ 'default_number_of_contacts' => '',
+ 'is_active' => '',
+ 'is_default' => '',
+ 'created_id' => '',
+ 'created_date' => '2013-07-28 08:49:19',
+ 'last_modified_id' => '',
+ 'last_modified_date' => '',
+ 'result_id' => '',
+ 'bypass_confirm' => '',
+ 'thankyou_title' => '',
+ 'thankyou_text' => '',
+ 'is_share' => '',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreateSurvey and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreateSurvey
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/SurveyTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using survey delete API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function survey_delete_example(){
-$params = array(
- 'id' => 1,
-);
-try{
- $result = civicrm_api3('survey', 'delete', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using survey delete API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function survey_delete_example() {
+ $params = array(
+ 'id' => 3,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('survey', 'delete', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function survey_delete_expectedresult(){
+function survey_delete_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'values' => true,
-);
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'values' => TRUE,
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testDeleteSurvey and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testDeleteSurvey
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/SurveyTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using survey get API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function survey_get_example(){
-$params = array(
- 'title' => 'survey title',
- 'activity_type_id' => '30',
- 'max_number_of_contacts' => 12,
- 'instructions' => 'Call people, ask for money',
-);
-try{
- $result = civicrm_api3('survey', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using survey get API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function survey_get_example() {
+ $params = array(
+ 'title' => 'survey title',
+ 'activity_type_id' => '30',
+ 'max_number_of_contacts' => 12,
+ 'instructions' => 'Call people, ask for money',
+ );
-return $result;
+ try{
+ $result = civicrm_api3('survey', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function survey_get_expectedresult(){
+function survey_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
- '1' => array(
- 'id' => '1',
- 'title' => 'survey title',
- 'activity_type_id' => '30',
- 'instructions' => 'Call people, ask for money',
- 'max_number_of_contacts' => '12',
- 'is_active' => '1',
- 'is_default' => 0,
- 'created_date' => '2013-07-28 08:49:19',
- 'bypass_confirm' => 0,
- 'is_share' => '1',
- ),
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 2,
+ 'values' => array(
+ '2' => array(
+ 'id' => '2',
+ 'title' => 'survey title',
+ 'activity_type_id' => '30',
+ 'instructions' => 'Call people, ask for money',
+ 'max_number_of_contacts' => '12',
+ 'is_active' => '1',
+ 'is_default' => 0,
+ 'created_date' => '2013-07-28 08:49:19',
+ 'bypass_confirm' => 0,
+ 'is_share' => '1',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetSurvey and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetSurvey
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/SurveyTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using survey_respondant get API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function survey_respondant_get_example(){
-$params = array(
- 'sequential' => '1',
- 'survey_id' => 1,
-);
-try{
- $result = civicrm_api3('survey_respondant', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using survey_respondant get API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function survey_respondant_get_example() {
+ $params = array(
+ 'sequential' => '1',
+ 'survey_id' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('survey_respondant', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function survey_respondant_get_expectedresult(){
+function survey_respondant_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 0,
- 'values' => array(),
-);
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 0,
+ 'values' => array(),
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetSurveyRespondants and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetSurveyRespondants
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/SurveyRespondantTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using system flush API
- * Flush all system caches *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function system_flush_example(){
-$params = array();
-try{
- $result = civicrm_api3('system', 'flush', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using system flush API.
+ *
+ * Flush all system caches
+ *
+ * @return array
+ * API result array
+ */
+function system_flush_example() {
+ $params = array();
-return $result;
+ try{
+ $result = civicrm_api3('system', 'flush', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function system_flush_expectedresult(){
+function system_flush_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'values' => 1,
-);
+ '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
-*
-* testFlush and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testFlush
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/SystemTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using tag create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function tag_create_example(){
-$params = array(
- 'name' => 'Super Heros',
- 'description' => 'Outside undie-wearers',
-);
-try{
- $result = civicrm_api3('tag', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using tag create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function tag_create_example() {
+ $params = array(
+ 'name' => 'Super Heros',
+ 'description' => 'Outside undie-wearers',
+ );
-return $result;
+ try{
+ $result = civicrm_api3('tag', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function tag_create_expectedresult(){
+function tag_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 12,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 12,
+ 'values' => array(
'12' => array(
- 'id' => '12',
- 'name' => 'Super Heros',
- 'description' => 'Outside undie-wearers',
- 'parent_id' => '',
- 'is_selectable' => '',
- 'is_reserved' => '',
- 'is_tagset' => '',
- 'used_for' => 'civicrm_contact',
- 'created_id' => '',
- 'created_date' => '2013-07-28 08:49:19',
- ),
+ 'id' => '12',
+ 'name' => 'Super Heros',
+ 'description' => 'Outside undie-wearers',
+ 'parent_id' => '',
+ 'is_selectable' => '',
+ 'is_reserved' => '',
+ 'is_tagset' => '',
+ 'used_for' => 'civicrm_contact',
+ 'created_id' => '',
+ 'created_date' => '2013-07-28 08:49:19',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreate and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreate
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/TagTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using tag delete API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function tag_delete_example(){
-$params = array(
- 'id' => '17',
-);
-try{
- $result = civicrm_api3('tag', 'delete', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using tag delete API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function tag_delete_example() {
+ $params = array(
+ 'id' => '17',
+ );
-return $result;
+ try{
+ $result = civicrm_api3('tag', 'delete', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function tag_delete_expectedresult(){
+function tag_delete_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'values' => true,
-);
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'values' => TRUE,
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testTagDeleteCorrectSyntax and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testTagDeleteCorrectSyntax
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/TagTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using tag get API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function tag_get_example(){
-$params = array(
- 'id' => '7',
- 'name' => 'New Tag3',
-);
-try{
- $result = civicrm_api3('tag', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using tag get API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function tag_get_example() {
+ $params = array(
+ 'id' => '7',
+ 'name' => 'New Tag3',
+ );
-return $result;
+ try{
+ $result = civicrm_api3('tag', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function tag_get_expectedresult(){
+function tag_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 7,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 7,
+ 'values' => array(
'7' => array(
- 'id' => '7',
- 'name' => 'New Tag3',
- 'description' => 'This is description for Our New Tag ',
- 'is_selectable' => '1',
- 'is_reserved' => 0,
- 'is_tagset' => 0,
- 'used_for' => 'civicrm_contact',
- 'created_date' => '2013-07-28 08:49:19',
- ),
+ 'id' => '7',
+ 'name' => 'New Tag3',
+ 'description' => 'This is description for Our New Tag ',
+ 'is_selectable' => '1',
+ 'is_reserved' => 0,
+ 'is_tagset' => 0,
+ 'used_for' => 'civicrm_contact',
+ 'created_date' => '2013-07-28 08:49:19',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGet and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGet
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/TagTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using tag getlist API
- * Demonstrates use of api.getlist for autocomplete and quicksearch applications *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function tag_getlist_example(){
-$params = array(
- 'input' => 'New Tag3',
- 'extra' => array(
+
+/**
+ * Test Generated example of using tag getlist API.
+ *
+ * Demonstrates use of api.getlist for autocomplete and quicksearch applications
+ *
+ * @return array
+ * API result array
+ */
+function tag_getlist_example() {
+ $params = array(
+ 'input' => 'New Tag3',
+ 'extra' => array(
'0' => 'used_for',
),
-);
+ );
-try{
- $result = civicrm_api3('tag', 'getlist', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+ try{
+ $result = civicrm_api3('tag', 'getlist', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
-return $result;
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function tag_getlist_expectedresult(){
+function tag_getlist_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 0,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 0,
+ 'values' => array(
'0' => array(
- 'id' => '19',
- 'label' => 'New Tag3',
- 'description' => array(
- '0' => 'This is description for Our New Tag ',
- ),
- 'extra' => array(
- 'used_for' => 'civicrm_contact',
- ),
+ 'id' => '19',
+ 'label' => 'New Tag3',
+ 'description' => array(
+ '0' => 'This is description for Our New Tag ',
),
+ 'extra' => array(
+ 'used_for' => 'civicrm_contact',
+ ),
+ ),
),
- 'page_num' => 1,
- 'more_results' => '',
-);
+ 'page_num' => 1,
+ 'more_results' => '',
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testTagGetList and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testTagGetList
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/TagTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using tag getfields API
- * demonstrate use of getfields to interrogate api *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function tag_getfields_example(){
-$params = array(
- 'action' => 'create',
-);
-try{
- $result = civicrm_api3('tag', 'getfields', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using tag getfields API.
+ *
+ * demonstrate use of getfields to interrogate api
+ *
+ * @return array
+ * API result array
+ */
+function tag_getfields_example() {
+ $params = array(
+ 'action' => 'create',
+ );
+
+ try{
+ $result = civicrm_api3('tag', 'getfields', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
-return $result;
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function tag_getfields_expectedresult(){
+function tag_getfields_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 10,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 10,
+ 'values' => array(
'id' => array(
- 'name' => 'id',
- 'type' => 1,
- 'title' => 'Tag ID',
- 'required' => true,
- 'api.aliases' => array(
- '0' => 'tag',
- ),
+ 'name' => 'id',
+ 'type' => 1,
+ 'title' => 'Tag ID',
+ 'required' => TRUE,
+ 'api.aliases' => array(
+ '0' => 'tag',
),
+ ),
'name' => array(
- 'name' => 'name',
- 'type' => 2,
- 'title' => 'Tag Name',
- 'required' => true,
- 'maxlength' => 64,
- 'size' => 30,
- 'api.required' => 1,
- ),
+ 'name' => 'name',
+ 'type' => 2,
+ 'title' => 'Tag Name',
+ 'required' => TRUE,
+ 'maxlength' => 64,
+ 'size' => 30,
+ 'api.required' => 1,
+ ),
'description' => array(
- 'name' => 'description',
- 'type' => 2,
- 'title' => 'Description',
- 'maxlength' => 255,
- 'size' => 45,
- ),
+ 'name' => 'description',
+ 'type' => 2,
+ 'title' => 'Description',
+ 'maxlength' => 255,
+ 'size' => 45,
+ ),
'parent_id' => array(
- 'name' => 'parent_id',
- 'type' => 1,
- 'title' => 'Parent Tag',
- 'default' => 'NULL',
- 'FKClassName' => 'CRM_Core_DAO_Tag',
- ),
+ 'name' => 'parent_id',
+ 'type' => 1,
+ 'title' => 'Parent Tag',
+ 'default' => 'NULL',
+ 'FKClassName' => 'CRM_Core_DAO_Tag',
+ 'FKApiName' => 'Tag',
+ ),
'is_selectable' => array(
- 'name' => 'is_selectable',
- 'type' => 16,
- 'title' => 'Display Tag?',
- 'default' => '1',
- ),
+ 'name' => 'is_selectable',
+ 'type' => 16,
+ 'title' => 'Display Tag?',
+ 'default' => '1',
+ ),
'is_reserved' => array(
- 'name' => 'is_reserved',
- 'type' => 16,
- 'title' => 'Reserved',
- ),
+ 'name' => 'is_reserved',
+ 'type' => 16,
+ 'title' => 'Reserved',
+ ),
'is_tagset' => array(
- 'name' => 'is_tagset',
- 'type' => 16,
- 'title' => 'Tagset',
- ),
+ 'name' => 'is_tagset',
+ 'type' => 16,
+ 'title' => 'Tagset',
+ ),
'used_for' => array(
- 'name' => 'used_for',
- 'type' => 2,
- 'title' => 'Used For',
- 'maxlength' => 64,
- 'size' => 30,
- 'default' => 'NULL',
- 'html' => array(
- 'type' => 'Select',
- ),
- 'pseudoconstant' => array(
- 'optionGroupName' => 'tag_used_for',
- ),
- 'api.default' => 'civicrm_contact',
+ 'name' => 'used_for',
+ 'type' => 2,
+ 'title' => 'Used For',
+ 'maxlength' => 64,
+ 'size' => 30,
+ 'default' => 'NULL',
+ 'html' => array(
+ 'type' => 'Select',
),
- 'created_id' => array(
- 'name' => 'created_id',
- 'type' => 1,
- 'title' => 'Tag Created By',
- 'FKClassName' => 'CRM_Contact_DAO_Contact',
+ 'pseudoconstant' => array(
+ 'optionGroupName' => 'tag_used_for',
),
+ 'api.default' => 'civicrm_contact',
+ ),
+ 'created_id' => array(
+ 'name' => 'created_id',
+ 'type' => 1,
+ 'title' => 'Tag Created By',
+ 'FKClassName' => 'CRM_Contact_DAO_Contact',
+ 'FKApiName' => 'Contact',
+ ),
'created_date' => array(
- 'name' => 'created_date',
- 'type' => 12,
- 'title' => 'Tag Created Date',
- ),
+ 'name' => 'created_date',
+ 'type' => 12,
+ 'title' => 'Tag Created Date',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testTagGetfields and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testTagGetfields
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/TagTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using tag get API
- * demonstrates use of Return as an array *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function tag_get_example(){
-$params = array(
- 'id' => '8',
- 'name' => 'New Tag3',
- 'return' => array(
+
+/**
+ * Test Generated example of using tag get API.
+ *
+ * demonstrates use of Return as an array
+ *
+ * @return array
+ * API result array
+ */
+function tag_get_example() {
+ $params = array(
+ 'id' => '8',
+ 'name' => 'New Tag3',
+ 'return' => array(
'0' => 'name',
),
-);
+ );
-try{
- $result = civicrm_api3('tag', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+ try{
+ $result = civicrm_api3('tag', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
-return $result;
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function tag_get_expectedresult(){
+function tag_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 8,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 8,
+ 'values' => array(
'8' => array(
- 'id' => '8',
- 'name' => 'New Tag3',
- ),
+ 'id' => '8',
+ 'name' => 'New Tag3',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetReturnArray and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetReturnArray
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/TagTest.php
*
* You can see the outcome of the API tests at
--- /dev/null
+<?php
+/**
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
+ */
+
+/**
+ * Test Generated example of using tax_contribution_page create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function tax_contribution_page_create_example() {
+ $params = array(
+ 'contact_id' => 1,
+ 'receive_date' => '20120511',
+ 'total_amount' => '100',
+ 'financial_type_id' => 11,
+ 'contribution_page_id' => 1,
+ 'trxn_id' => 12345,
+ 'invoice_id' => 67890,
+ 'source' => 'SSF',
+ 'contribution_status_id' => 2,
+ );
+
+ try{
+ $result = civicrm_api3('tax_contribution_page', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
+}
+
+/**
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
+ */
+function tax_contribution_page_create_expectedresult() {
+
+ $expectedResult = array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
+ '1' => array(
+ 'id' => '1',
+ 'contact_id' => '1',
+ 'financial_type_id' => '11',
+ 'contribution_page_id' => '1',
+ 'payment_instrument_id' => '4',
+ 'receive_date' => '20120511000000',
+ 'non_deductible_amount' => '',
+ 'total_amount' => '120',
+ 'fee_amount' => 0,
+ 'net_amount' => '120',
+ 'trxn_id' => '12345',
+ 'invoice_id' => '67890',
+ 'currency' => 'USD',
+ 'cancel_date' => '',
+ 'cancel_reason' => '',
+ 'receipt_date' => '',
+ 'thankyou_date' => '',
+ 'source' => 'SSF',
+ 'amount_level' => '',
+ 'contribution_recur_id' => '',
+ 'is_test' => '',
+ 'is_pay_later' => '',
+ 'contribution_status_id' => '2',
+ 'address_id' => '',
+ 'check_number' => '',
+ 'campaign_id' => '',
+ 'creditnote_id' => '',
+ 'tax_amount' => '20',
+ 'contribution_type_id' => '11',
+ ),
+ ),
+ );
+
+ return $expectedResult;
+}
+
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreateContributionPendingOnline
+* and can be found in
+* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/TaxContributionPageTest.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/explorer
+*
+* 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
+/**
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
+ */
+
+/**
+ * Test Generated example of using tax_contribution_page create API.
+ *
+ * Create Contribution with Nested Line Items
+ *
+ * @return array
+ * API result array
+ */
+function tax_contribution_page_create_example() {
+ $params = array(
+ 'contact_id' => 1,
+ 'receive_date' => '20120511',
+ 'total_amount' => '400',
+ 'financial_type_id' => 7,
+ 'trxn_id' => 12345,
+ 'invoice_id' => 67890,
+ 'source' => 'SSF',
+ 'contribution_status_id' => 1,
+ 'skipLineItem' => 1,
+ 'api.line_item.create' => array(
+ '0' => array(
+ 'price_field_id' => array(
+ '0' => 3,
+ ),
+ 'qty' => 1,
+ 'line_total' => '100',
+ 'unit_price' => '100',
+ 'financial_type_id' => 7,
+ ),
+ '1' => array(
+ 'price_field_id' => array(
+ '0' => 3,
+ ),
+ 'qty' => 1,
+ 'line_total' => '300',
+ 'unit_price' => '300',
+ 'financial_type_id' => 8,
+ ),
+ ),
+ );
+
+ try{
+ $result = civicrm_api3('tax_contribution_page', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
+}
+
+/**
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
+ */
+function tax_contribution_page_create_expectedresult() {
+
+ $expectedResult = array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
+ '1' => array(
+ 'id' => '1',
+ 'contact_id' => '1',
+ 'financial_type_id' => '7',
+ 'contribution_page_id' => '',
+ 'payment_instrument_id' => '4',
+ 'receive_date' => '20120511000000',
+ 'non_deductible_amount' => '',
+ 'total_amount' => '435',
+ 'fee_amount' => 0,
+ 'net_amount' => '435',
+ 'trxn_id' => '12345',
+ 'invoice_id' => '67890',
+ 'currency' => 'USD',
+ 'cancel_date' => '',
+ 'cancel_reason' => '',
+ 'receipt_date' => '',
+ 'thankyou_date' => '',
+ 'source' => 'SSF',
+ 'amount_level' => '',
+ 'contribution_recur_id' => '',
+ 'is_test' => '',
+ 'is_pay_later' => '',
+ 'contribution_status_id' => '1',
+ 'address_id' => '',
+ 'check_number' => '',
+ 'campaign_id' => '',
+ 'creditnote_id' => '',
+ 'tax_amount' => '35',
+ 'contribution_type_id' => '7',
+ 'api.line_item.create' => array(
+ '0' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
+ '0' => array(
+ 'id' => '1',
+ 'entity_table' => 'civicrm_contribution',
+ 'entity_id' => '1',
+ 'contribution_id' => '1',
+ 'price_field_id' => array(
+ '0' => '3',
+ ),
+ 'label' => 'line item',
+ 'qty' => '1',
+ 'unit_price' => '100',
+ 'line_total' => '100',
+ 'participant_count' => '',
+ 'price_field_value_id' => '',
+ 'financial_type_id' => '7',
+ 'deductible_amount' => '',
+ 'tax_amount' => '20',
+ ),
+ ),
+ ),
+ '1' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 2,
+ 'values' => array(
+ '0' => array(
+ 'id' => '2',
+ 'entity_table' => 'civicrm_contribution',
+ 'entity_id' => '1',
+ 'contribution_id' => '1',
+ 'price_field_id' => array(
+ '0' => '3',
+ ),
+ 'label' => 'line item',
+ 'qty' => '1',
+ 'unit_price' => '300',
+ 'line_total' => '300',
+ 'participant_count' => '',
+ 'price_field_value_id' => '',
+ 'financial_type_id' => '8',
+ 'deductible_amount' => '',
+ 'tax_amount' => '15',
+ ),
+ ),
+ ),
+ ),
+ ),
+ ),
+ );
+
+ return $expectedResult;
+}
+
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreateContributionChainedLineItems
+* and can be found in
+* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/TaxContributionPageTest.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/explorer
+*
+* 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
+/**
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
+ */
+
+/**
+ * Test Generated example of using tax_contribution_page delete API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function tax_contribution_page_delete_example() {
+ $params = array(
+ 'id' => 1,
+ );
+
+ try{
+ $result = civicrm_api3('tax_contribution_page', 'delete', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
+}
+
+/**
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
+ */
+function tax_contribution_page_delete_expectedresult() {
+
+ $expectedResult = array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
+ '1' => 1,
+ ),
+ );
+
+ return $expectedResult;
+}
+
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testDeleteContribution
+* and can be found in
+* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/TaxContributionPageTest.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/explorer
+*
+* 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
+*/
<?php
/**
- * Test Generated example of using uf_field create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function uf_field_create_example(){
-$params = array(
- 'field_name' => 'phone',
- 'field_type' => 'Contact',
- 'visibility' => 'Public Pages and Listings',
- 'weight' => 1,
- 'label' => 'Test Phone',
- 'is_searchable' => 1,
- 'is_active' => 1,
- 'location_type_id' => 1,
- 'phone_type_id' => 1,
- 'uf_group_id' => 11,
-);
-try{
- $result = civicrm_api3('uf_field', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using uf_field create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function uf_field_create_example() {
+ $params = array(
+ 'field_name' => 'phone',
+ 'field_type' => 'Contact',
+ 'visibility' => 'Public Pages and Listings',
+ 'weight' => 1,
+ 'label' => 'Test Phone',
+ 'is_searchable' => 1,
+ 'is_active' => 1,
+ 'location_type_id' => 1,
+ 'phone_type_id' => 1,
+ 'uf_group_id' => 11,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('uf_field', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function uf_field_create_expectedresult(){
+function uf_field_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'uf_group_id' => '11',
- 'field_name' => 'phone',
- 'is_active' => '1',
- 'is_view' => '',
- 'is_required' => '',
- 'weight' => '1',
- 'help_post' => '',
- 'help_pre' => '',
- 'visibility' => 'Public Pages and Listings',
- 'in_selector' => '',
- 'is_searchable' => '1',
- 'location_type_id' => '1',
- 'phone_type_id' => '1',
- 'website_type_id' => '',
- 'label' => 'Test Phone',
- 'field_type' => 'Contact',
- 'is_reserved' => '',
- 'is_multi_summary' => '',
- ),
+ 'id' => '1',
+ 'uf_group_id' => '11',
+ 'field_name' => 'phone',
+ 'is_active' => '1',
+ 'is_view' => '',
+ 'is_required' => '',
+ 'weight' => '1',
+ 'help_post' => '',
+ 'help_pre' => '',
+ 'visibility' => 'Public Pages and Listings',
+ 'in_selector' => '',
+ 'is_searchable' => '1',
+ 'location_type_id' => '1',
+ 'phone_type_id' => '1',
+ 'website_type_id' => '',
+ 'label' => 'Test Phone',
+ 'field_type' => 'Contact',
+ 'is_reserved' => '',
+ 'is_multi_summary' => '',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreateUFField and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreateUFField
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/UFFieldTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using uf_field delete API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function uf_field_delete_example(){
-$params = array(
- 'field_id' => 1,
-);
-try{
- $result = civicrm_api3('uf_field', 'delete', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using uf_field delete API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function uf_field_delete_example() {
+ $params = array(
+ 'field_id' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('uf_field', 'delete', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function uf_field_delete_expectedresult(){
+function uf_field_delete_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'values' => true,
-);
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'values' => TRUE,
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testDeleteUFField and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testDeleteUFField
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/UFFieldTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using uf_field get API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function uf_field_get_example(){
-$params = array();
-try{
- $result = civicrm_api3('uf_field', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using uf_field get API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function uf_field_get_example() {
+ $params = array();
-return $result;
+ try{
+ $result = civicrm_api3('uf_field', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function uf_field_get_expectedresult(){
+function uf_field_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'uf_group_id' => '11',
- 'field_name' => 'phone',
- 'is_active' => '1',
- 'is_view' => 0,
- 'is_required' => 0,
- 'weight' => '1',
- 'visibility' => 'Public Pages and Listings',
- 'in_selector' => 0,
- 'is_searchable' => '1',
- 'location_type_id' => '1',
- 'phone_type_id' => '1',
- 'label' => 'Test Phone',
- 'field_type' => 'Contact',
- 'is_multi_summary' => 0,
- ),
+ 'id' => '1',
+ 'uf_group_id' => '11',
+ 'field_name' => 'phone',
+ 'is_active' => '1',
+ 'is_view' => 0,
+ 'is_required' => 0,
+ 'weight' => '1',
+ 'visibility' => 'Public Pages and Listings',
+ 'in_selector' => 0,
+ 'is_searchable' => '1',
+ 'location_type_id' => '1',
+ 'phone_type_id' => '1',
+ 'label' => 'Test Phone',
+ 'field_type' => 'Contact',
+ 'is_multi_summary' => 0,
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetUFFieldSuccess and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetUFFieldSuccess
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/UFFieldTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using uf_field replace API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function uf_field_replace_example(){
-$params = array(
- 'uf_group_id' => 11,
- 'option.autoweight' => '',
- 'values' => array(
+
+/**
+ * Test Generated example of using uf_field replace API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function uf_field_replace_example() {
+ $params = array(
+ 'uf_group_id' => 11,
+ 'option.autoweight' => '',
+ 'values' => array(
'0' => array(
- 'field_name' => 'first_name',
- 'field_type' => 'Contact',
- 'visibility' => 'Public Pages and Listings',
- 'weight' => 3,
- 'label' => 'Test First Name',
- 'is_searchable' => 1,
- 'is_active' => 1,
- ),
+ 'field_name' => 'first_name',
+ 'field_type' => 'Contact',
+ 'visibility' => 'Public Pages and Listings',
+ 'weight' => 3,
+ 'label' => 'Test First Name',
+ 'is_searchable' => 1,
+ 'is_active' => 1,
+ ),
'1' => array(
- 'field_name' => 'country',
- 'field_type' => 'Contact',
- 'visibility' => 'Public Pages and Listings',
- 'weight' => 2,
- 'label' => 'Test Country',
- 'is_searchable' => 1,
- 'is_active' => 1,
- 'location_type_id' => 1,
- ),
+ 'field_name' => 'country',
+ 'field_type' => 'Contact',
+ 'visibility' => 'Public Pages and Listings',
+ 'weight' => 2,
+ 'label' => 'Test Country',
+ 'is_searchable' => 1,
+ 'is_active' => 1,
+ 'location_type_id' => 1,
+ ),
'2' => array(
- 'field_name' => 'phone',
- 'field_type' => 'Contact',
- 'visibility' => 'Public Pages and Listings',
- 'weight' => 1,
- 'label' => 'Test Phone',
- 'is_searchable' => 1,
- 'is_active' => 1,
- 'location_type_id' => 1,
- 'phone_type_id' => 1,
- ),
+ 'field_name' => 'phone',
+ 'field_type' => 'Contact',
+ 'visibility' => 'Public Pages and Listings',
+ 'weight' => 1,
+ 'label' => 'Test Phone',
+ 'is_searchable' => 1,
+ 'is_active' => 1,
+ 'location_type_id' => 1,
+ 'phone_type_id' => 1,
+ ),
),
-);
+ );
-try{
- $result = civicrm_api3('uf_field', 'replace', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+ try{
+ $result = civicrm_api3('uf_field', 'replace', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
-return $result;
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function uf_field_replace_expectedresult(){
+function uf_field_replace_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 3,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 3,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'uf_group_id' => '11',
- 'field_name' => 'first_name',
- 'is_active' => '1',
- 'is_view' => '',
- 'is_required' => '',
- 'weight' => '3',
- 'help_post' => '',
- 'help_pre' => '',
- 'visibility' => 'Public Pages and Listings',
- 'in_selector' => '',
- 'is_searchable' => '1',
- 'location_type_id' => '',
- 'phone_type_id' => '',
- 'website_type_id' => '',
- 'label' => 'Test First Name',
- 'field_type' => 'Contact',
- 'is_reserved' => '',
- 'is_multi_summary' => '',
- ),
+ 'id' => '1',
+ 'uf_group_id' => '11',
+ 'field_name' => 'first_name',
+ 'is_active' => '1',
+ 'is_view' => '',
+ 'is_required' => '',
+ 'weight' => '3',
+ 'help_post' => '',
+ 'help_pre' => '',
+ 'visibility' => 'Public Pages and Listings',
+ 'in_selector' => '',
+ 'is_searchable' => '1',
+ 'location_type_id' => '',
+ 'phone_type_id' => '',
+ 'website_type_id' => '',
+ 'label' => 'Test First Name',
+ 'field_type' => 'Contact',
+ 'is_reserved' => '',
+ 'is_multi_summary' => '',
+ ),
'2' => array(
- 'id' => '2',
- 'uf_group_id' => '11',
- 'field_name' => 'country',
- 'is_active' => '1',
- 'is_view' => '',
- 'is_required' => '',
- 'weight' => '2',
- 'help_post' => '',
- 'help_pre' => '',
- 'visibility' => 'Public Pages and Listings',
- 'in_selector' => '',
- 'is_searchable' => '1',
- 'location_type_id' => '1',
- 'phone_type_id' => '',
- 'website_type_id' => '',
- 'label' => 'Test Country',
- 'field_type' => 'Contact',
- 'is_reserved' => '',
- 'is_multi_summary' => '',
- ),
+ 'id' => '2',
+ 'uf_group_id' => '11',
+ 'field_name' => 'country',
+ 'is_active' => '1',
+ 'is_view' => '',
+ 'is_required' => '',
+ 'weight' => '2',
+ 'help_post' => '',
+ 'help_pre' => '',
+ 'visibility' => 'Public Pages and Listings',
+ 'in_selector' => '',
+ 'is_searchable' => '1',
+ 'location_type_id' => '1',
+ 'phone_type_id' => '',
+ 'website_type_id' => '',
+ 'label' => 'Test Country',
+ 'field_type' => 'Contact',
+ 'is_reserved' => '',
+ 'is_multi_summary' => '',
+ ),
'3' => array(
- 'id' => '3',
- 'uf_group_id' => '11',
- 'field_name' => 'phone',
- 'is_active' => '1',
- 'is_view' => '',
- 'is_required' => '',
- 'weight' => '1',
- 'help_post' => '',
- 'help_pre' => '',
- 'visibility' => 'Public Pages and Listings',
- 'in_selector' => '',
- 'is_searchable' => '1',
- 'location_type_id' => '1',
- 'phone_type_id' => '1',
- 'website_type_id' => '',
- 'label' => 'Test Phone',
- 'field_type' => 'Contact',
- 'is_reserved' => '',
- 'is_multi_summary' => '',
- ),
+ 'id' => '3',
+ 'uf_group_id' => '11',
+ 'field_name' => 'phone',
+ 'is_active' => '1',
+ 'is_view' => '',
+ 'is_required' => '',
+ 'weight' => '1',
+ 'help_post' => '',
+ 'help_pre' => '',
+ 'visibility' => 'Public Pages and Listings',
+ 'in_selector' => '',
+ 'is_searchable' => '1',
+ 'location_type_id' => '1',
+ 'phone_type_id' => '1',
+ 'website_type_id' => '',
+ 'label' => 'Test Phone',
+ 'field_type' => 'Contact',
+ 'is_reserved' => '',
+ 'is_multi_summary' => '',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testReplaceUFFields and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testReplaceUFFields
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/UFFieldTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using uf_group create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function uf_group_create_example(){
-$params = array(
- 'add_captcha' => 1,
- 'add_contact_to_group' => 1,
- 'group' => 1,
- 'cancel_URL' => 'http://example.org/cancel',
- 'created_date' => '2009-06-27 00:00:00',
- 'created_id' => 1,
- 'group_type' => 'Individual,Contact',
- 'help_post' => 'help post',
- 'help_pre' => 'help pre',
- 'is_active' => 0,
- 'is_cms_user' => 1,
- 'is_edit_link' => 1,
- 'is_map' => 1,
- 'is_reserved' => 1,
- 'is_uf_link' => 1,
- 'is_update_dupe' => 1,
- 'name' => 'Test_Group',
- 'notify' => 'admin@example.org',
- 'post_URL' => 'http://example.org/post',
- 'title' => 'Test Group',
-);
-try{
- $result = civicrm_api3('uf_group', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using uf_group create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function uf_group_create_example() {
+ $params = array(
+ 'add_captcha' => 1,
+ 'add_contact_to_group' => 1,
+ 'group' => 1,
+ 'cancel_URL' => 'http://example.org/cancel',
+ 'created_date' => '2009-06-27 00:00:00',
+ 'created_id' => 1,
+ 'group_type' => 'Individual,Contact',
+ 'help_post' => 'help post',
+ 'help_pre' => 'help pre',
+ 'is_active' => 0,
+ 'is_cms_user' => 1,
+ 'is_edit_link' => 1,
+ 'is_map' => 1,
+ 'is_reserved' => 1,
+ 'is_uf_link' => 1,
+ 'is_update_dupe' => 1,
+ 'name' => 'Test_Group',
+ 'notify' => 'admin@example.org',
+ 'post_URL' => 'http://example.org/post',
+ 'title' => 'Test Group',
+ );
-return $result;
+ try{
+ $result = civicrm_api3('uf_group', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function uf_group_create_expectedresult(){
+function uf_group_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 2,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 2,
+ 'values' => array(
'2' => array(
- 'id' => '2',
- 'is_active' => 0,
- 'group_type' => 'Individual,Contact',
- 'title' => 'Test Group',
- 'description' => '',
- 'help_pre' => 'help pre',
- 'help_post' => 'help post',
- 'limit_listings_group_id' => '1',
- 'post_URL' => 'http://example.org/post',
- 'add_to_group_id' => '1',
- 'add_captcha' => '1',
- 'is_map' => '1',
- 'is_edit_link' => '1',
- 'is_uf_link' => '1',
- 'is_update_dupe' => '1',
- 'cancel_URL' => 'http://example.org/cancel',
- 'is_cms_user' => '1',
- 'notify' => 'admin@example.org',
- 'is_reserved' => '1',
- 'name' => 'Test_Group_2',
- 'created_id' => '1',
- 'created_date' => '2013-07-28 08:49:19',
- 'is_proximity_search' => '',
- ),
+ 'id' => '2',
+ 'is_active' => 0,
+ 'group_type' => 'Individual,Contact',
+ 'title' => 'Test Group',
+ 'description' => '',
+ 'help_pre' => 'help pre',
+ 'help_post' => 'help post',
+ 'limit_listings_group_id' => '1',
+ 'post_URL' => 'http://example.org/post',
+ 'add_to_group_id' => '1',
+ 'add_captcha' => '1',
+ 'is_map' => '1',
+ 'is_edit_link' => '1',
+ 'is_uf_link' => '1',
+ 'is_update_dupe' => '1',
+ 'cancel_URL' => 'http://example.org/cancel',
+ 'is_cms_user' => '1',
+ 'notify' => 'admin@example.org',
+ 'is_reserved' => '1',
+ 'name' => 'Test_Group_2',
+ 'created_id' => '1',
+ 'created_date' => '2013-07-28 08:49:19',
+ 'is_proximity_search' => '',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testUFGroupCreate and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testUFGroupCreate
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/UFGroupTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using uf_group delete API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function uf_group_delete_example(){
-$params = array(
- 'id' => 2,
-);
-try{
- $result = civicrm_api3('uf_group', 'delete', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using uf_group delete API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function uf_group_delete_example() {
+ $params = array(
+ 'id' => 2,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('uf_group', 'delete', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function uf_group_delete_expectedresult(){
+function uf_group_delete_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'values' => true,
-);
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'values' => TRUE,
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testUFGroupDelete and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testUFGroupDelete
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/UFGroupTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using uf_group get API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function uf_group_get_example(){
-$params = array(
- 'id' => 2,
-);
-try{
- $result = civicrm_api3('uf_group', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using uf_group get API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function uf_group_get_example() {
+ $params = array(
+ 'id' => 2,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('uf_group', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function uf_group_get_expectedresult(){
+function uf_group_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 2,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 2,
+ 'values' => array(
'2' => array(
- 'id' => '2',
- 'is_active' => 0,
- 'group_type' => 'Individual,Contact',
- 'title' => 'Test Group',
- 'help_pre' => 'help pre',
- 'help_post' => 'help post',
- 'limit_listings_group_id' => '1',
- 'post_URL' => 'http://example.org/post',
- 'add_to_group_id' => '1',
- 'add_captcha' => '1',
- 'is_map' => '1',
- 'is_edit_link' => '1',
- 'is_uf_link' => '1',
- 'is_update_dupe' => '1',
- 'cancel_URL' => 'http://example.org/cancel',
- 'is_cms_user' => '1',
- 'notify' => 'admin@example.org',
- 'is_reserved' => '1',
- 'name' => 'Test_Group_2',
- 'created_id' => '1',
- 'created_date' => '2013-07-28 08:49:19',
- 'is_proximity_search' => 0,
- ),
+ 'id' => '2',
+ 'is_active' => 0,
+ 'group_type' => 'Individual,Contact',
+ 'title' => 'Test Group',
+ 'help_pre' => 'help pre',
+ 'help_post' => 'help post',
+ 'limit_listings_group_id' => '1',
+ 'post_URL' => 'http://example.org/post',
+ 'add_to_group_id' => '1',
+ 'add_captcha' => '1',
+ 'is_map' => '1',
+ 'is_edit_link' => '1',
+ 'is_uf_link' => '1',
+ 'is_update_dupe' => '1',
+ 'cancel_URL' => 'http://example.org/cancel',
+ 'is_cms_user' => '1',
+ 'notify' => 'admin@example.org',
+ 'is_reserved' => '1',
+ 'name' => 'Test_Group_2',
+ 'created_id' => '1',
+ 'created_date' => '2013-07-28 08:49:19',
+ 'is_proximity_search' => 0,
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testUFGroupGet and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testUFGroupGet
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/UFGroupTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using uf_join create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function uf_join_create_example(){
-$params = array(
- 'module' => 'CiviContribute',
- 'entity_table' => 'civicrm_contribution_page',
- 'entity_id' => 1,
- 'weight' => 1,
- 'uf_group_id' => 11,
- 'is_active' => 1,
- 'sequential' => 1,
-);
-try{
- $result = civicrm_api3('uf_join', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using uf_join create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function uf_join_create_example() {
+ $params = array(
+ 'module' => 'CiviContribute',
+ 'entity_table' => 'civicrm_contribution_page',
+ 'entity_id' => 1,
+ 'weight' => 1,
+ 'uf_group_id' => 11,
+ 'is_active' => 1,
+ 'sequential' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('uf_join', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function uf_join_create_expectedresult(){
+function uf_join_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 0,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 0,
+ 'values' => array(
'0' => array(
- 'id' => '1',
- 'is_active' => '1',
- 'module' => 'CiviContribute',
- 'entity_table' => 'civicrm_contribution_page',
- 'entity_id' => '1',
- 'weight' => '1',
- 'uf_group_id' => '11',
- 'module_data' => '',
- ),
+ 'id' => '1',
+ 'is_active' => '1',
+ 'module' => 'CiviContribute',
+ 'entity_table' => 'civicrm_contribution_page',
+ 'entity_id' => '1',
+ 'weight' => '1',
+ 'uf_group_id' => '11',
+ 'module_data' => '',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreateUFJoin and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreateUFJoin
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/UFJoinTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using uf_join get API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function uf_join_get_example(){
-$params = array(
- 'entity_table' => 'civicrm_contribution_page',
- 'entity_id' => 1,
- 'sequential' => 1,
-);
-try{
- $result = civicrm_api3('uf_join', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using uf_join get API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function uf_join_get_example() {
+ $params = array(
+ 'entity_table' => 'civicrm_contribution_page',
+ 'entity_id' => 1,
+ 'sequential' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('uf_join', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function uf_join_get_expectedresult(){
+function uf_join_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'0' => array(
- 'id' => '1',
- 'is_active' => '1',
- 'module' => 'CiviContribute',
- 'entity_table' => 'civicrm_contribution_page',
- 'entity_id' => '1',
- 'weight' => '1',
- 'uf_group_id' => '11',
- ),
+ 'id' => '1',
+ 'is_active' => '1',
+ 'module' => 'CiviContribute',
+ 'entity_table' => 'civicrm_contribution_page',
+ 'entity_id' => '1',
+ 'weight' => '1',
+ 'uf_group_id' => '11',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetUFJoinId and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetUFJoinId
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/UFJoinTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using uf_match get API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function uf_match_get_example(){
-$params = array(
- 'contact_id' => 69,
-);
-try{
- $result = civicrm_api3('uf_match', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using uf_match get API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function uf_match_get_example() {
+ $params = array(
+ 'contact_id' => 69,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('uf_match', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function uf_match_get_expectedresult(){
+function uf_match_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'domain_id' => '1',
- 'uf_id' => '42',
- 'contact_id' => '69',
- ),
+ 'id' => '1',
+ 'domain_id' => '1',
+ 'uf_id' => '42',
+ 'contact_id' => '69',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetUFID and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetUFID
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/UFMatchTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using website create API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function website_create_example(){
-$params = array(
- 'contact_id' => 3,
- 'url' => 'website.com',
- 'website_type_id' => 1,
-);
-try{
- $result = civicrm_api3('website', 'create', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using website create API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function website_create_example() {
+ $params = array(
+ 'contact_id' => 3,
+ 'url' => 'website.com',
+ 'website_type_id' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('website', 'create', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function website_create_expectedresult(){
+function website_create_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 1,
+ 'values' => array(
'1' => array(
- 'id' => '1',
- 'contact_id' => '3',
- 'url' => 'website.com',
- 'website_type_id' => '1',
- ),
+ 'id' => '1',
+ 'contact_id' => '3',
+ 'url' => 'website.com',
+ 'website_type_id' => '1',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testCreateWebsite and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testCreateWebsite
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/WebsiteTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using website delete API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function website_delete_example(){
-$params = array(
- 'id' => 1,
-);
-try{
- $result = civicrm_api3('website', 'delete', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using website delete API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function website_delete_example() {
+ $params = array(
+ 'id' => 3,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('website', 'delete', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function website_delete_expectedresult(){
+function website_delete_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'values' => 1,
-);
+ '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
-*
-* testDeleteWebsite and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testDeleteWebsite
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/WebsiteTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using website get API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function website_get_example(){
-$params = array(
- 'contact_id' => 1,
- 'url' => 'website.com',
- 'website_type_id' => 1,
-);
-try{
- $result = civicrm_api3('website', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using website get API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function website_get_example() {
+ $params = array(
+ 'contact_id' => 4,
+ 'url' => 'website.com',
+ 'website_type_id' => 1,
+ );
-return $result;
+ try{
+ $result = civicrm_api3('website', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
+
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function website_get_expectedresult(){
+function website_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 1,
- 'id' => 1,
- 'values' => array(
- '1' => array(
- 'id' => '1',
- 'contact_id' => '1',
- 'url' => 'website.com',
- 'website_type_id' => '1',
- ),
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 1,
+ 'id' => 2,
+ 'values' => array(
+ '2' => array(
+ 'id' => '2',
+ 'contact_id' => '4',
+ 'url' => 'website.com',
+ 'website_type_id' => '1',
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetWebsite and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetWebsite
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/WebsiteTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using website getfields API
- * *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function website_getfields_example(){
-$params = array(
- 'action' => 'get',
-);
-try{
- $result = civicrm_api3('website', 'getfields', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+/**
+ * Test Generated example of using website getfields API.
+ *
+ *
+ * @return array
+ * API result array
+ */
+function website_getfields_example() {
+ $params = array(
+ 'action' => 'get',
+ );
+
+ try{
+ $result = civicrm_api3('website', 'getfields', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
-return $result;
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function website_getfields_expectedresult(){
+function website_getfields_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 4,
- 'values' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 4,
+ 'values' => array(
'id' => array(
- 'name' => 'id',
- 'type' => 1,
- 'title' => 'Website ID',
- 'required' => true,
- 'api.aliases' => array(
- '0' => 'website_id',
- ),
+ 'name' => 'id',
+ 'type' => 1,
+ 'title' => 'Website ID',
+ 'required' => TRUE,
+ 'api.aliases' => array(
+ '0' => 'website_id',
),
+ ),
'contact_id' => array(
- 'name' => 'contact_id',
- 'type' => 1,
- 'title' => 'Contact',
- 'FKClassName' => 'CRM_Contact_DAO_Contact',
- ),
+ 'name' => 'contact_id',
+ 'type' => 1,
+ 'title' => 'Contact',
+ 'FKClassName' => 'CRM_Contact_DAO_Contact',
+ 'FKApiName' => 'Contact',
+ ),
'url' => array(
- 'name' => 'url',
- 'type' => 2,
- 'title' => 'Website',
- 'maxlength' => 128,
- 'size' => 30,
- 'import' => true,
- 'where' => 'civicrm_website.url',
- 'headerPattern' => '/Website/i',
- 'dataPattern' => '/^[A-Za-z][0-9A-Za-z]{20,}$/',
- 'export' => true,
- 'html' => array(
- 'type' => 'Text',
- ),
+ 'name' => 'url',
+ 'type' => 2,
+ 'title' => 'Website',
+ 'maxlength' => 128,
+ 'size' => 30,
+ 'import' => TRUE,
+ 'where' => 'civicrm_website.url',
+ 'headerPattern' => '/Website/i',
+ 'dataPattern' => '/^[A-Za-z][0-9A-Za-z]{20,}$/',
+ 'export' => TRUE,
+ 'html' => array(
+ 'type' => 'Text',
),
+ ),
'website_type_id' => array(
- 'name' => 'website_type_id',
- 'type' => 1,
- 'title' => 'Website Type',
- 'html' => array(
- 'type' => 'Select',
- ),
- 'pseudoconstant' => array(
- 'optionGroupName' => 'website_type',
- ),
+ 'name' => 'website_type_id',
+ 'type' => 1,
+ 'title' => 'Website Type',
+ 'html' => array(
+ 'type' => 'Select',
+ ),
+ 'pseudoconstant' => array(
+ 'optionGroupName' => 'website_type',
),
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetFields and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetFields
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/WebsiteTest.php
*
* You can see the outcome of the API tests at
<?php
/**
- * Test Generated example of using website get API
- * Demonostrates returning field metadata *
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
*/
-function website_get_example(){
-$params = array(
- 'options' => array(
+
+/**
+ * Test Generated example of using website get API.
+ *
+ * Demonostrates returning field metadata
+ *
+ * @return array
+ * API result array
+ */
+function website_get_example() {
+ $params = array(
+ 'options' => array(
'metadata' => array(
- '0' => 'fields',
- ),
+ '0' => 'fields',
+ ),
),
-);
+ );
-try{
- $result = civicrm_api3('website', 'get', $params);
-}
-catch (CiviCRM_API3_Exception $e) {
- // handle error here
- $errorMessage = $e->getMessage();
- $errorCode = $e->getErrorCode();
- $errorData = $e->getExtraParams();
- return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}
+ try{
+ $result = civicrm_api3('website', 'get', $params);
+ }
+ catch (CiviCRM_API3_Exception $e) {
+ // Handle error here.
+ $errorMessage = $e->getMessage();
+ $errorCode = $e->getErrorCode();
+ $errorData = $e->getExtraParams();
+ return array(
+ 'error' => $errorMessage,
+ 'error_code' => $errorCode,
+ 'error_data' => $errorData,
+ );
+ }
-return $result;
+ return $result;
}
/**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ * API result array
*/
-function website_get_expectedresult(){
+function website_get_expectedresult() {
$expectedResult = array(
- 'is_error' => 0,
- 'version' => 3,
- 'count' => 0,
- 'values' => array(),
- 'metadata' => array(
+ 'is_error' => 0,
+ 'version' => 3,
+ 'count' => 0,
+ 'values' => array(),
+ 'metadata' => array(
'fields' => array(
- 'id' => array(
- 'name' => 'id',
- 'type' => '1',
- 'title' => 'Website ID',
- 'required' => '1',
- 'api.aliases' => array(
- '0' => 'website_id',
- ),
- ),
- 'contact_id' => array(
- 'name' => 'contact_id',
- 'type' => '1',
- 'title' => 'Contact',
- 'FKClassName' => 'CRM_Contact_DAO_Contact',
- ),
- 'url' => array(
- 'name' => 'url',
- 'type' => '2',
- 'title' => 'Website',
- 'maxlength' => '128',
- 'size' => '30',
- 'import' => '1',
- 'where' => 'civicrm_website.url',
- 'headerPattern' => '/Website/i',
- 'dataPattern' => '/^[A-Za-z][0-9A-Za-z]{20,}$/',
- 'export' => '1',
- 'html' => array(
- 'type' => 'Text',
- ),
- ),
- 'website_type_id' => array(
- 'name' => 'website_type_id',
- 'type' => '1',
- 'title' => 'Website Type',
- 'html' => array(
- 'type' => 'Select',
- ),
- 'pseudoconstant' => array(
- 'optionGroupName' => 'website_type',
- ),
- ),
+ 'id' => array(
+ 'name' => 'id',
+ 'type' => '1',
+ 'title' => 'Website ID',
+ 'required' => '1',
+ 'api.aliases' => array(
+ '0' => 'website_id',
+ ),
),
+ 'contact_id' => array(
+ 'name' => 'contact_id',
+ 'type' => '1',
+ 'title' => 'Contact',
+ 'FKClassName' => 'CRM_Contact_DAO_Contact',
+ 'FKApiName' => 'Contact',
+ ),
+ 'url' => array(
+ 'name' => 'url',
+ 'type' => '2',
+ 'title' => 'Website',
+ 'maxlength' => '128',
+ 'size' => '30',
+ 'import' => '1',
+ 'where' => 'civicrm_website.url',
+ 'headerPattern' => '/Website/i',
+ 'dataPattern' => '/^[A-Za-z][0-9A-Za-z]{20,}$/',
+ 'export' => '1',
+ 'html' => array(
+ 'type' => 'Text',
+ ),
+ ),
+ 'website_type_id' => array(
+ 'name' => 'website_type_id',
+ 'type' => '1',
+ 'title' => 'Website Type',
+ 'html' => array(
+ 'type' => 'Select',
+ ),
+ 'pseudoconstant' => array(
+ 'optionGroupName' => 'website_type',
+ ),
+ ),
+ ),
),
-);
+ );
return $expectedResult;
}
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* testGetMetadata and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* testGetMetadata
+* and can be found in
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/WebsiteTest.php
*
* You can see the outcome of the API tests at