update examples"
authoreileenmcnaughton <eileen@fuzion.co.nz>
Thu, 15 Jan 2015 07:16:04 +0000 (07:16 +0000)
committereileenmcnaughton <eileen@fuzion.co.nz>
Tue, 27 Jan 2015 01:03:25 +0000 (01:03 +0000)
243 files changed:
api/v3/examples/Activity/ContactRefCustomField.php
api/v3/examples/Activity/ContactRefCustomFieldGet.php
api/v3/examples/Activity/Create.php
api/v3/examples/Activity/DateTimeHigh.php
api/v3/examples/Activity/DateTimeLow.php
api/v3/examples/Activity/Delete.php
api/v3/examples/Activity/Get.php
api/v3/examples/Activity/GetTargetandAssignee.php
api/v3/examples/Activity/Getfields.php
api/v3/examples/Activity/ReturnAssigneeContact.php
api/v3/examples/ActivityContact/Create.php
api/v3/examples/ActivityContact/Delete.php
api/v3/examples/ActivityType/Create.php
api/v3/examples/ActivityType/Get.php
api/v3/examples/Address/AddressLike.php
api/v3/examples/Address/AddressParse.php
api/v3/examples/Address/AddressSort.php
api/v3/examples/Address/Create.php
api/v3/examples/Address/Delete.php
api/v3/examples/Address/Get.php
api/v3/examples/Batch/Create.php
api/v3/examples/Batch/Delete.php
api/v3/examples/Batch/Get.php
api/v3/examples/Batch/Update.php
api/v3/examples/Campaign/Create.php
api/v3/examples/Campaign/Delete.php
api/v3/examples/Campaign/Get.php
api/v3/examples/Case/Create.php
api/v3/examples/Constant/Get.php
api/v3/examples/Contact/APIChainedArray.php
api/v3/examples/Contact/APIChainedArrayFormats.php
api/v3/examples/Contact/APIChainedArrayMultipleCustom.php
api/v3/examples/Contact/APIChainedArrayValuesFromSiblingFunction.php
api/v3/examples/Contact/ChainTwoWebsites.php
api/v3/examples/Contact/ChainTwoWebsitesSyntax2.php
api/v3/examples/Contact/Create.php
api/v3/examples/Contact/CustomFieldGet.php
api/v3/examples/Contact/CustomFieldGetReturnSyntaxVariation.php
api/v3/examples/Contact/Delete.php
api/v3/examples/Contact/FormatIsSuccess_Fail.php
api/v3/examples/Contact/FormatIsSuccess_True.php
api/v3/examples/Contact/FormatOnlyID.php
api/v3/examples/Contact/FormatSingleValue.php
api/v3/examples/Contact/Get.php
api/v3/examples/Contact/GetActions.php
api/v3/examples/Contact/GetCountContact.php
api/v3/examples/Contact/GetFieldsOptions.php
api/v3/examples/Contact/GetSingleContact.php
api/v3/examples/Contact/Getoptions.php
api/v3/examples/Contact/GroupFilterUsingContactAPI.php
api/v3/examples/Contribution/ContributionCreateWithHonoreeContact.php
api/v3/examples/Contribution/ContributionCreateWithNote.php
api/v3/examples/Contribution/ContributionCreateWithSoftCredit.php
api/v3/examples/Contribution/ContributionCreateWithSoftCreditDefaults.php
api/v3/examples/Contribution/Create.php
api/v3/examples/Contribution/CreateWithNestedLineItems.php
api/v3/examples/Contribution/Delete.php
api/v3/examples/Contribution/Get.php
api/v3/examples/ContributionPage/Create.php
api/v3/examples/ContributionPage/Delete.php
api/v3/examples/ContributionPage/Get.php
api/v3/examples/ContributionPage/Submit.php
api/v3/examples/ContributionRecur/Create.php
api/v3/examples/ContributionRecur/Delete.php
api/v3/examples/ContributionRecur/Get.php
api/v3/examples/ContributionSoft/Create.php
api/v3/examples/ContributionSoft/Delete.php
api/v3/examples/ContributionSoft/Get.php
api/v3/examples/Country/Create.php
api/v3/examples/Country/Delete.php
api/v3/examples/Country/Get.php
api/v3/examples/CustomField/Create.php
api/v3/examples/CustomField/Delete.php
api/v3/examples/CustomGroup/Create.php
api/v3/examples/CustomGroup/Delete.php
api/v3/examples/CustomGroup/Get.php
api/v3/examples/CustomValue/Create.php
api/v3/examples/CustomValue/Get.php
api/v3/examples/CustomValue/formatFieldName.php
api/v3/examples/Domain/Create.php
api/v3/examples/Domain/Get.php
api/v3/examples/Email/Create.php
api/v3/examples/Email/Delete.php
api/v3/examples/Email/NestedReplaceEmail.php
api/v3/examples/Email/Replace.php
api/v3/examples/EntityTag/Create.php
api/v3/examples/EntityTag/Delete.php
api/v3/examples/EntityTag/Get.php
api/v3/examples/Event/Create.php
api/v3/examples/Event/Delete.php
api/v3/examples/Event/Get.php
api/v3/examples/Event/IsCurrentOption.php
api/v3/examples/Event/IsFullOption.php
api/v3/examples/Grant/Create.php
api/v3/examples/Grant/Delete.php
api/v3/examples/Grant/Get.php
api/v3/examples/Group/Get.php
api/v3/examples/Group/getfields.php
api/v3/examples/GroupContact/Create.php
api/v3/examples/GroupContact/Delete.php
api/v3/examples/GroupContact/Get.php
api/v3/examples/GroupContact/GetWithGroupID.php
api/v3/examples/GroupNesting/Create.php
api/v3/examples/GroupNesting/Delete.php
api/v3/examples/GroupNesting/Get.php
api/v3/examples/GroupOrganization/Create.php
api/v3/examples/GroupOrganization/Delete.php
api/v3/examples/GroupOrganization/Get.php
api/v3/examples/Im/Create.php
api/v3/examples/Im/Delete.php
api/v3/examples/Im/Get.php
api/v3/examples/Job/Create.php
api/v3/examples/Job/Delete.php
api/v3/examples/LineItem/Create.php
api/v3/examples/LineItem/Delete.php
api/v3/examples/LineItem/Get.php
api/v3/examples/LocBlock/createEntities.php
api/v3/examples/LocBlock/getEntities.php
api/v3/examples/LocBlock/simpleCreate.php
api/v3/examples/MailSettings/ChainedGetDelete.php
api/v3/examples/MailSettings/Create.php
api/v3/examples/MailSettings/Delete.php
api/v3/examples/MailSettings/Get.php
api/v3/examples/Mailing/Create.php
api/v3/examples/Mailing/Delete.php
api/v3/examples/Mailing/Submit.php [new file with mode: 0644]
api/v3/examples/MailingGroup/Subscribe.php
api/v3/examples/Membership/Create.php
api/v3/examples/Membership/Delete.php
api/v3/examples/Membership/Get.php
api/v3/examples/Membership/Update.php
api/v3/examples/Membership/filterIsCurrent.php
api/v3/examples/MembershipPayment/Create.php
api/v3/examples/MembershipPayment/Get.php
api/v3/examples/MembershipStatus/Create.php
api/v3/examples/MembershipStatus/Get.php
api/v3/examples/MembershipType/Create.php
api/v3/examples/MembershipType/Delete.php
api/v3/examples/MembershipType/Get.php
api/v3/examples/MessageTemplate/Create.php
api/v3/examples/MessageTemplate/Delete.php
api/v3/examples/MessageTemplate/Get.php
api/v3/examples/Note/Create.php
api/v3/examples/Note/Delete.php
api/v3/examples/Note/Get.php
api/v3/examples/OptionGroup/Create.php
api/v3/examples/OptionGroup/Delete.php
api/v3/examples/OptionGroup/Get.php
api/v3/examples/OptionValue/Get.php
api/v3/examples/OptionValue/SortOption.php
api/v3/examples/Participant/Create.php
api/v3/examples/Participant/CreateParticipantPayment.php
api/v3/examples/Participant/Get.php
api/v3/examples/Participant/NestedDelete.php
api/v3/examples/Participant/NestedEventGet.php
api/v3/examples/ParticipantPayment/Create.php
api/v3/examples/ParticipantPayment/Delete.php
api/v3/examples/ParticipantPayment/Get.php
api/v3/examples/ParticipantStatusType/Create.php
api/v3/examples/ParticipantStatusType/Delete.php
api/v3/examples/ParticipantStatusType/Get.php
api/v3/examples/PaymentProcessor/Create.php
api/v3/examples/PaymentProcessor/Delete.php
api/v3/examples/PaymentProcessorType/Create.php
api/v3/examples/PaymentProcessorType/Delete.php
api/v3/examples/Phone/Create.php
api/v3/examples/Phone/Delete.php
api/v3/examples/Phone/Get.php
api/v3/examples/Pledge/Create.php
api/v3/examples/Pledge/Delete.php
api/v3/examples/Pledge/Get.php
api/v3/examples/Pledge/GetFilterHighDate.php
api/v3/examples/PledgePayment/Create.php
api/v3/examples/PledgePayment/Delete.php
api/v3/examples/PledgePayment/Get.php
api/v3/examples/PledgePayment/Update.php
api/v3/examples/PriceField/Create.php
api/v3/examples/PriceField/Delete.php
api/v3/examples/PriceField/Get.php
api/v3/examples/PriceFieldValue/Create.php
api/v3/examples/PriceFieldValue/Delete.php
api/v3/examples/PriceFieldValue/Get.php
api/v3/examples/PriceSet/Create.php
api/v3/examples/PriceSet/Delete.php
api/v3/examples/PriceSet/Get.php
api/v3/examples/Profile/Apply.php
api/v3/examples/Profile/Get.php
api/v3/examples/Profile/GetFields.php
api/v3/examples/Profile/Submit.php
api/v3/examples/Relationship/BetweenRelationshipType.php
api/v3/examples/Relationship/Create.php
api/v3/examples/Relationship/Delete.php
api/v3/examples/Relationship/Get.php
api/v3/examples/Relationship/INRelationshipType.php
api/v3/examples/Relationship/NotBetweenRelationshipType.php
api/v3/examples/Relationship/NotInRelationshipType.php
api/v3/examples/Relationship/filterIsCurrent.php
api/v3/examples/RelationshipType/Create.php
api/v3/examples/RelationshipType/Delete.php
api/v3/examples/ReportTemplate/Getrows.php
api/v3/examples/ReportTemplate/Getstatistics.php
api/v3/examples/Setting/Create.php
api/v3/examples/Setting/CreateAllDomains.php
api/v3/examples/Setting/CreateSettingCurrentDomain.php
api/v3/examples/Setting/CreateSpecifiedDomains.php
api/v3/examples/Setting/Get.php
api/v3/examples/Setting/GetAllDomains.php
api/v3/examples/Setting/GetDefaults.php
api/v3/examples/Setting/GetFields.php
api/v3/examples/Setting/GetSettingCurrentDomain.php
api/v3/examples/Setting/GetSpecifiedDomains.php
api/v3/examples/Setting/GetValue.php
api/v3/examples/Setting/Revert.php
api/v3/examples/Survey/ChainedGetDelete.php
api/v3/examples/Survey/Create.php
api/v3/examples/Survey/Delete.php
api/v3/examples/Survey/Get.php
api/v3/examples/SurveyRespondant/Get.php
api/v3/examples/System/Flush.php
api/v3/examples/Tag/Create.php
api/v3/examples/Tag/Delete.php
api/v3/examples/Tag/Get.php
api/v3/examples/Tag/GetList.php
api/v3/examples/Tag/Getfields.php
api/v3/examples/Tag/getReturnArray.php
api/v3/examples/TaxContributionPage/Create.php [new file with mode: 0644]
api/v3/examples/TaxContributionPage/CreateWithNestedLineItems.php [new file with mode: 0644]
api/v3/examples/TaxContributionPage/Delete.php [new file with mode: 0644]
api/v3/examples/UFField/Create.php
api/v3/examples/UFField/Delete.php
api/v3/examples/UFField/Get.php
api/v3/examples/UFField/Replace.php
api/v3/examples/UFGroup/Create.php
api/v3/examples/UFGroup/Delete.php
api/v3/examples/UFGroup/Get.php
api/v3/examples/UFJoin/Create.php
api/v3/examples/UFJoin/Get.php
api/v3/examples/UFMatch/Get.php
api/v3/examples/Website/Create.php
api/v3/examples/Website/Delete.php
api/v3/examples/Website/Get.php
api/v3/examples/Website/GetFields.php
api/v3/examples/Website/GetWithMetadata.php

index 59aecdce51782503457db0e052d8564c5742e0b8..18a75b92e2926d73b3f2340870f2957267498d38 100644 (file)
 <?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
index cdd214c6f7d8fab3949fb7496295b33d310b4287..18273b9bf8612a3f78a0148565d3597f081702e7 100644 (file)
@@ -1,72 +1,89 @@
 <?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
index b8fffb7e7cf6563604b79276e3499fb20fe70941..8fd89f938c24afa36122bfab87afc6503e4965d2 100644 (file)
 <?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
index 906dbd616963d4e489d537d3e965037fcc969bd8..c00406e34243df3e6095a32649f4402e07bf04d4 100644 (file)
@@ -1,67 +1,84 @@
 <?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
index 6e40ca7db0634358531765659f34b280ecb7645e..9b5876833c0e22c72779c5ab61edbdae2fa3ad27 100644 (file)
@@ -1,66 +1,83 @@
 <?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
index e6b3779ebecbdf67130392383433dd3232e97436..537c11ae7a5fa02752c9dec32710c8c88bef39ee 100644 (file)
@@ -1,47 +1,63 @@
 <?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
index b56306c981eb21dc87dd2db393a4fcb91bee18ac..41dd137696d71b4254872744c48ebc189dace36a 100644 (file)
@@ -1,66 +1,82 @@
 <?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
index 98d33e59144236db91b2ad997f640163e5f27d9c..b309ada5abe7f9c6c837a5948e9b2f7f43ada351 100644 (file)
 <?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
index 74243d755ad4e7c1c043e6aa94b4b87c82f66447..08e3dd68ec753b23a1f613ac9d3604e818910182 100644 (file)
 <?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
index 60950c3c746370d2c7bd4a63049e45449a9f8f25..e3e4cea2cc398a58a6122d3c33c2321c3fc4bf50 100644 (file)
 <?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
index 2919adb3b19f9fb232346c3e26374d8c297fffe6..c984f860974eb9038791461be51225eb3c355dea 100644 (file)
@@ -1,57 +1,73 @@
 <?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
index f9783f4939aefc1877a5d198b299917db739fdc9..c708787fa84f7ba2877a19a3981e95220c1fd54e 100644 (file)
@@ -1,47 +1,63 @@
 <?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
index ca223a613df0dc587d77a3cdc8a748aaf4d6ae42..64bfe2683ab9ba562b03830e4e05420cad4c3031 100644 (file)
@@ -1,72 +1,89 @@
 <?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
index 7bbfc2d4a2f924bbd983ef0cdd4b1ea20e739b07..26aaeff97b55912553be8ae1fa50547696a84fac 100644 (file)
@@ -1,35 +1,51 @@
 <?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',
@@ -78,17 +94,20 @@ function activity_type_get_expectedresult(){
       '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
index f79170c2a72e0059b4b01f3fd6ace6ffb0f31b11..c9938ce6b9ebb4e66f5064d1f9bd7e38122d4665 100644 (file)
@@ -1,66 +1,83 @@
 <?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
index 70b23ffaf1a554a6b0c87a06535a9e5fb0395754..aa9adae1530a65269f1478162645d45d3f12892d 100644 (file)
@@ -1,65 +1,82 @@
 <?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
index 661f045a448737f99e44ac2f183569fdab75f0bc..57508f48021fa5ece443bc4995e17d734dd0c79c 100644 (file)
@@ -1,85 +1,97 @@
 <?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
index 4bf7651c31b8090e4971dfdbba58ddaeaf0c18fc..eb28a04fdd586947b9bbc3070b6bc53700c15d45 100644 (file)
@@ -1,71 +1,87 @@
 <?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
index f7f05957121692e5c30db752f23c5a00203ed9ae..8fbd3120ebfd0988c56bbea4516f113e34f9504b 100644 (file)
@@ -1,47 +1,63 @@
 <?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
index 668815c8150c927d30087d6bd513d220891aa045..ca99c19856d78196cdca3670cdd113212c28bd2a 100644 (file)
@@ -1,64 +1,80 @@
 <?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
index abc7aa1ae87169cc78b26efdf44db9d7f6de5d8b..14ea9def541e1e02ad055d07370579f8990ebf3f 100644 (file)
@@ -1,73 +1,89 @@
 <?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
index 04c5786a41929180e893c4cb57d07a6d48f3c728..bf8987d16dc4ee045884359350612375e2244fa7 100644 (file)
@@ -1,47 +1,63 @@
 <?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
index a7c2bedfe035c797c20e609fe5ace692005b4ae0..157ccd4ad47c81a3126579894d538a0702576521 100644 (file)
@@ -1,56 +1,72 @@
 <?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
index 988677ff79d7477b318e9b18c24f02f256f076df..22e827f0256d5b261d12043549265582afd2cb5d 100644 (file)
@@ -1,73 +1,89 @@
 <?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
index db10057f56dedfa87ec9ec12665a0ec004370827..08e6f39b1bdf7f0c8f5b49408b07571ef4884960 100644 (file)
@@ -1,70 +1,87 @@
 <?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
index 2ff722001fad09e33c61ece14e791073ca7d5c3c..f5560431bc6bf90c97f7c0acc07f60132fc8c953 100644 (file)
@@ -1,47 +1,63 @@
 <?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
index de1cb1423c2775080e648059996f3378ba7e4614..b74d75a67887a2510c981de13c5d3f7a7c2d8eec 100644 (file)
@@ -1,59 +1,75 @@
 <?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
index b7327d0dd5e35673b0c8675ae3ce4ea1a1a93828..77cc2cff2f49347b848c29e03e6196d7240d0d53 100644 (file)
@@ -1,61 +1,77 @@
 <?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
index a48977eaab4e48e0dc31a289ef1b8e816ce7aabe..00665d32a5d268d5c0a7713d153f81687f58cfa3 100644 (file)
@@ -1,53 +1,69 @@
 <?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
index 697d93470da3c99b197c5a320d4db02f485b8823..05365f4e7c16e6b5badbb8cc3e997455f10b4d51 100644 (file)
 <?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
index 98e8d34e268d3c506b7f47f106f8ca959b509d85..14eb3eb7be6ee96239922d8e0cb467f290132c45 100644 (file)
 <?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
index c6e1c4b1943f1b5e66c3592db17636b02f231323..aec99c1e613464c7cf2045475506cb0fa2586977 100644 (file)
 <?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
index 88f03c4624931b0d93a5bf668d6bffb1c9d5c163..d5340153d56e8cb2fe8d2d2d7c733c38322472d6 100644 (file)
 <?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
index 422aedeee615c50b57b4db1bb5baebbb16611270..0d5eeaf2f16e5bf6679f3440875be1b6072beaa8 100644 (file)
@@ -1,15 +1,25 @@
 <?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,
@@ -22,166 +32,175 @@ $params = array(
       '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
index 34690ede4d61653b5bea1d5cf12e3925fcf8c6ab..e5ff6921db6c3dd523689d360a54de0047e96deb 100644 (file)
@@ -1,15 +1,25 @@
 <?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,
@@ -22,171 +32,180 @@ $params = array(
       '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
index 3eeb35b611a8acec4deeb65f8b7301239cc67d8c..b14ed5c77c7a458daaecf00c29369923441eefb6 100644 (file)
 <?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
index 14a0fccf3b67071317906d346c27605f49228fb0..c6409e5d813d3019d350c8b89e33e63536b5c423 100644 (file)
@@ -1,56 +1,73 @@
 <?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
index 9ee0fbe8f4932f3dfec54568413bc869ea88f16e..8568539b8bd46d6bc44171139d0a45a7d9a7594c 100644 (file)
@@ -1,56 +1,73 @@
 <?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
index e845ca0b55521cf7e16e2350a294065d5f634a7d..f33093c3d5b9f22550d00a4b2a376d49ac36ecf9 100644 (file)
@@ -1,47 +1,63 @@
 <?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
index c8241ae9fcaebb56e4ef50c1d664368e2ab0c27e..2aa9dd395ba271d873127d27db6a549f0aba08a1 100644 (file)
@@ -1,44 +1,61 @@
 <?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
index 0c57c1262c8c7928d139868688b6aa2c08e3c49a..6fb4583556ea02b5b64f5a7f0b2fc60d35c7a839 100644 (file)
@@ -1,44 +1,61 @@
 <?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
index 641e8b3ea209a96c76f3b72d7e44fb3f8373de65..c7273d10990a4598fb5eab56b8b1ef94804a5b14 100644 (file)
@@ -1,45 +1,62 @@
 <?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
index 18c620057103821d211fbd59b43d971fc7907546..8678de3c844f2d5397d36783325f8e2541d62536 100644 (file)
@@ -1,45 +1,62 @@
 <?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
index 13e368caa0ac9573daa908ae3015864a20804f56..d14a2c7159a35817ec63ddb7acd7b31ee17d3082 100644 (file)
 <?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
index 5e9ebfc99ebe1dba215a834c5b697cb62fad8a1b..efd03c4a9e911d12ea4b1be70bcc1a03c9aac9c3 100644 (file)
@@ -1,67 +1,89 @@
 <?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
index 466acc181ada28d8bd0124e1a31ad6956f9b6e02..dc8cf026aaeded1b6e52661cc2bfde175473e890 100644 (file)
@@ -1,43 +1,60 @@
 <?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
index 36309b48a0960fd95ee1a2e862d1271a931a8248..7425c141fec1418c84d36228d5441ff901803b0f 100644 (file)
 <?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
index c2fa77de64f86056b8a69f9bb4868793c2f1c269..ef15484569b29b9bcde85d1a0e39c7c8eeaafaa5 100644 (file)
 <?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
index 23997f5a6369ad96c3e5da7b7ecebf516fb3879b..c7ed0a575fd1ddb4124e7617dec2d69fb9aacbc4 100644 (file)
@@ -1,50 +1,67 @@
 <?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
index 7099c96631f28b23221240b8ab570185a800ecf1..9d3df4cf958520b4d941b5497263de05b024d54d 100644 (file)
 <?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
index 1b5edf550eefa996519431f8478d386016b4ade6..fb2a044465c074e85adf55b51f3c196ea9ad167d 100644 (file)
 <?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
index 6cd86fea80d9ddb6f563d19d6c13aa390e43e4c2..d8e1fb903d9f7e6ff081fb38d144427d95935dc6 100644 (file)
 <?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
index 5b4e1cfe1e0fc13d8474449c4ff6eb807bf6d075..3bb8a9baca4bf8b7a8b127a7f9e21380f4004885 100644 (file)
 <?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
index 15b486beaa62dc0562535c1fb84916ffeab7d796..ed48e642c96f55b96043c022743d124eb1030093 100644 (file)
 <?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
index b95cd2a3d791f53cfb0f3b6d55ea651cbf75cb26..a1d467c21f29a5112536634b1edfc15f9fb72c98 100644 (file)
 <?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
index cb73ee2c99a86c59121bf163898f536d4ec96dd4..e36b07fafd9827e409139f0eff506de8ed74ed37 100644 (file)
 <?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
index 5db15956624e3604565e497b3f13c0afcbdfbf68..dea4e1e41925ee7b664526e98e0a65c7900020a9 100644 (file)
@@ -1,50 +1,66 @@
 <?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
index 4636716e0bdc4c31bf9a84928aa196bd1f0aaca9..549a7e4b171215a55c82e7069a3a80e59efe0e90 100644 (file)
 <?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
index b03529023e70916cc2a61251237993c4ffc02941..893abfbb57be035aa2303bad351425dbea20054d 100644 (file)
 <?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
index 24ddce65201be9db11484dd2a0521af6076d42dd..08d3f01aeba2d477ffcf3f26715c2d580c156d07 100644 (file)
@@ -1,47 +1,63 @@
 <?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
index 55dbd5ad5da9f2c707eeafae4d2ef2a1db6d47a1..64e6641df7f4867c26186483a3ae55a21dc56560 100644 (file)
@@ -1,73 +1,89 @@
 <?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
index 6c0cefb0defe1cc598c5617321d299bf6876c6fd..e380559ee4bacd7f7034fd769972419e1ea62e38 100644 (file)
@@ -1,67 +1,84 @@
 <?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
index 4fcb5e025cab6f75537c60a45d99253a7eb069d3..2ea2c9bf67f0a19b2244937ba7c11f3b47f8b1e4 100644 (file)
 <?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
index b104226df9a95bdfd2b9fd18a07d9527872c36cd..d1a1ca0741804a03f726f1f0223060144b2eb0da 100644 (file)
@@ -1,47 +1,63 @@
 <?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
index d9ae74745fff66c514631f96b1c848dca6e038c3..4a938ac26b314ff655de27a4ad4457fba3cefe65 100644 (file)
@@ -1,66 +1,82 @@
 <?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
index ff9f74771828c233eda248b8c513e5f436dbc74a..00e20b2b076cfefb8cc2809088b60476d0003007 100644 (file)
@@ -1,65 +1,81 @@
 <?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
index c8c6f6e6d984062584dfcf70b0e24e9c37990ccf..c2e2f09e9a2b0a022473e8ce6dfae47d3d6ac9c2 100644 (file)
@@ -1,42 +1,58 @@
 <?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
index efad77eef3b3eaa36d3041c72b15c99254faf833..24281a6d0af6ec1b69089a0c1b5982333dc0269b 100644 (file)
@@ -1,58 +1,74 @@
 <?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
index 7789a17ac03bc4cb784a21a20a8c716b69c7a789..6d8c3775f32c33faefc1e746c40f282111b589ee 100644 (file)
@@ -1,62 +1,78 @@
 <?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
index 6080fa0f69067e3985e4ec70ff501dfc2cf6e572..7c6df427df5139262fd2116873b7073537ad9f39 100644 (file)
@@ -1,47 +1,63 @@
 <?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
index ea03ca4ee660d91ce01caaeb023d568a96557720..e96dec6cf57a85b934000e3678a44764229f073c 100644 (file)
@@ -1,56 +1,72 @@
 <?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
index 4a1b8024751c4b37e50d4c4e291f36a907253d90..83b8352b4cf7c8fa7b500587172ec2f651593cfa 100644 (file)
 <?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
index f8ae1d5f47be07fcd491918b342960170531fc2b..3c0c46a0e4bd3eed46b6f0130918343594704f36 100644 (file)
@@ -1,47 +1,63 @@
 <?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
index a78eb124cc9ddae751a3b31cfadcf555ea170307..859b44c11a3f1fdb3d2ddf0790837a0c6becb6c2 100644 (file)
@@ -1,81 +1,97 @@
 <?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
index e2ff22aaa74fee864b4438fee5358e70fe7337a8..3cbc73a6f9a0fd2e5389236ad2fad92270542d8a 100644 (file)
@@ -1,47 +1,63 @@
 <?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
index 417295207d2fb3a1b44e5acb7cdb97cf3121ae4a..da5c935d2a867bfa98cbba7ae14ed7a4411c0045 100644 (file)
@@ -1,63 +1,79 @@
 <?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
index 18d85519c910e233e5a0962a20ff839fffc81081..b46846b50237228da08d586cf5b2f30fc342aa46 100644 (file)
@@ -1,48 +1,64 @@
 <?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
index 2cc9c048abeff64826e8b5a472b1f2e35b72cd46..4bd831388b2618638fb640a056c26a93f52b9786 100644 (file)
 <?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
index 82e6f157dea55abf51fb98212beb794b0b309503..e1238e6ebd1958bbaefdbc8ea751212b400d9684 100644 (file)
 <?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
index d0265f65f439909102af06294f41b2ee93c09b95..8a27360bb7536dcc3b0fb0fd65a3577015cf88c6 100644 (file)
@@ -1,62 +1,78 @@
 <?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
index e81e455be0a7b9a82dcac16c64ad25d82f1ffb0c..d88fe1637973cddad3a74b0615b47c6ecc602067 100644 (file)
 <?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
index 62f85de66f2b666f14bf2e99c05006dc8155281b..951036bfb54ea83368f85794e686eb2336943970 100644 (file)
@@ -1,66 +1,82 @@
 <?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
index c76f539ad893b10611962140dec8cd6e8cc53ab2..54ef848a51e4978bd8455550624a7662d6641ebd 100644 (file)
@@ -1,47 +1,63 @@
 <?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
index 0c5299d411439d03ed18fd1f24ea73e5df7eba37..2da60eb9d30636116f3604ecef7a6e65b940f962 100644 (file)
 <?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
index f6b95fb5534777a2f884202deb15f64877ed30fb..213b82a9e39b745323be137160905c4e28af34bf 100644 (file)
 <?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
index bce9448343c28208869fc99da1dd056087da3274..b08bd1cb4a8fb1993ae8e0346de38baa8f7e7cb1 100644 (file)
@@ -1,48 +1,64 @@
 <?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
index 908982a7371285c725c32231a0136beec12cedb2..e5bbe53ecf8eb355195ef5b1cec3cb9969a556b0 100644 (file)
@@ -1,48 +1,64 @@
 <?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
index 9124d42310ef6481ff3cef1acc51b674eb41baa8..2f4f2d8b40c624e1db8d1e7a60ff322840b61cbb 100644 (file)
@@ -1,48 +1,64 @@
 <?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
index fb15e40699e8170ed3d6fd24aeb437c753d53284..98a7025d9154da9b645b6492698c72034e728536 100644 (file)
 <?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
index 72b1b8f59ee1622d3c4251559d52705b293a24c2..8a9bcbf8edb42d9b70b134201e84dc65e8964ac3 100644 (file)
@@ -1,47 +1,63 @@
 <?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
index a8aa0eb99fb0ba1811f2a0b78945dafe40343996..cf68137c7af1d3de8d20069d6f70f8751e71b9a6 100644 (file)
@@ -1,75 +1,92 @@
 <?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
index b1f3a15598468f71809fbec059d58294166723c9..41c990a1f394eb12d601c925da5dfe092e91ad0d 100644 (file)
 <?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
index bfa1cd0f7d8ed52de41dc5e64884c897ba608290..872c86ad15e20605224f21e93b4e19339ff8442e 100644 (file)
@@ -1,70 +1,88 @@
 <?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
index 9c118cbb20ea961d0aa6dc767dce7d01901d6bab..478cd1398b21fe94ccf95f8bb81f4841e8225d04 100644 (file)
@@ -1,73 +1,89 @@
 <?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
index 7719a922f074d9b2c6a5c6aefe1412f11358aa3b..ab4a452c1ae104c429b9efa0a10fae5ca330bb21 100644 (file)
@@ -1,47 +1,63 @@
 <?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
index 15fbbf2bd09a83d97af58e44850c2f73278aeac6..33b4e65ec4aa197e59a016334cf81223ec389fa3 100644 (file)
@@ -1,60 +1,76 @@
 <?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
index b164e7311d04e9bc861c697d27a58fd193962b4e..710c4691410832f5bdd399a110abd2d2834cfa49 100644 (file)
@@ -1,66 +1,82 @@
 <?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
index 3dd054b10075af8617837a08496ec21085282bc7..4e5330bc707fabe44cf3d0ef6839f601e08d5757 100644 (file)
 <?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
index 0e3ad3b7d77c2904929e66669b1ecd26f7cef53c..930139a5ee699820997eb1b4e01bc73520016708 100644 (file)
@@ -1,52 +1,68 @@
 <?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
index c61c1a74e7114a1588864c1f17b3dd9ed6cdf5ff..1a3829a96932c8415f5b6f0505ee5e17bfe5cee9 100644 (file)
@@ -1,51 +1,67 @@
 <?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
index 4cf76d0935a474c836fee45c232d3a1f21a2c091..d78b1df66b6c092b2687fe4e560845c8f53aedd0 100644 (file)
@@ -1,58 +1,74 @@
 <?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
index 62a9b3d1153fb1ece31f52737b2f6ccf74be4c18..bf4d830233169448c55f3ddf2337ee0f93ed2fb0 100644 (file)
 <?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
index 6f8c63421fe56be2f794a594acd6e73150e48e4a..d53c24b7e8894e438bedd02a1e3ef74187676ab1 100644 (file)
@@ -1,51 +1,67 @@
 <?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
index e5562e17512c34130a87d0b52a36895bfe02415c..c88f00527c1a2a281cbf86c7d171fa49be3ec5a6 100644 (file)
@@ -1,47 +1,63 @@
 <?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
index 3aa9aaa4a0cf835ea2a5976955a2c8cb4e2201f5..d054477c2a3014e9cd366cecca0cd670b12febc9 100644 (file)
@@ -1,55 +1,71 @@
 <?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
index 6df4b1ee461dd03e30f8f92351fc64b45d22c8da..7e23bff87dc969c15d026d04c01be7e5992d4f76 100644 (file)
@@ -1,53 +1,69 @@
 <?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
index 51ab52d0b51afd506683599fc3b28bd0783d9488..381bc73e724185cb96110ca04707ed1c2f6f15d9 100644 (file)
@@ -1,47 +1,63 @@
 <?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
index f6ef40f7ed735edef6c8f5a3bb76d5f85f9a08c6..ad8616bedc51b41bac1acdc52f5af9253160e7d6 100644 (file)
@@ -1,47 +1,63 @@
 <?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
index 905e87dafdc5df7d64ec79bb60a1a6835afeacea..04e0377a1dbe90376835757cfa1f6f9e9920b5b2 100644 (file)
@@ -1,61 +1,77 @@
 <?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
index 980311040a3dfc1967a4054ecb555a675764a6fb..8eaf1435dd967ca18ba66c278846aada9fd40b53 100644 (file)
@@ -1,47 +1,63 @@
 <?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
index 0269a1b0a23d16ff576d06c0d2af9ef046ba40b2..d9351b1779d246bb6d3ad7abdae2033597095e1b 100644 (file)
@@ -1,61 +1,77 @@
 <?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
index e8a6d8e746ff6fd2cfcaaa6bd78bdbaf505cc06c..5b2e81460bb45585787ac3d636385d963fe81752 100644 (file)
@@ -1,68 +1,84 @@
 <?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
index 759d3d36e9c008db56477fb2f79dce1a6c98bd9b..9b063df98d531280abbc3fb38694ec9af0a12147 100644 (file)
@@ -1,42 +1,58 @@
 <?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
index 520a7601b045f1d834597ad069af45c9c9090dfb..1f4931164ce4216cd2996ac8530e61e9675dea05 100644 (file)
@@ -1,71 +1,88 @@
 <?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
index 125969e4c71788dee14f72f44386385772a8d250..181d9b22e72fba12be3393f2438560d288b3a9af 100644 (file)
@@ -1,47 +1,63 @@
 <?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
index feeb147c232985d7a3b89f197f8c48d452b9c1dc..3c01833fe4b791b63af27aa7f52a2c05f2ac676e 100644 (file)
@@ -1,63 +1,79 @@
 <?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
index a10c0e2a0116b8cf1b5893ad16f51f779bf93e02..0932d1bb128acdf99ad88e85d29dff24aa42ddea 100644 (file)
 <?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
index a79cd0bc1d1a37629542a8ae1992184bbdd000a6..e8d63399342194c658d1b34356208de93623e6da 100644 (file)
 <?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
index 5bc9adb710db41d6751c9f4c0d87454380410766..7cd8d4d37ba98ff87b9459429467fb122124d517 100644 (file)
@@ -1,62 +1,79 @@
 <?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
index 4f4c520998afe22ed0e7956d5b3acb37b1187cca..fabcab76c982f564e2b2bc230387f028b4a72556 100644 (file)
@@ -1,79 +1,96 @@
 <?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
index f465c2942b48776aed149b7507ee591c87437b56..2dd6c621f416c2a673d64b67500af37684b55b8f 100644 (file)
@@ -1,72 +1,88 @@
 <?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
index 482d9c33969e864cbbb01f16b1e69ed843004ef1..80f9d8149d57df54720510b0785893e9c55c1619 100644 (file)
@@ -1,47 +1,63 @@
 <?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
index 0083f7008efab4cc59a4d15b5144a10b45061788..8e2c97a3a3c723f22ed06bac651dd73daddff27b 100644 (file)
@@ -1,67 +1,83 @@
 <?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
index fed0c7dd8f3aa5cfea45b597b1ceb3c817a0e9a7..8e49d23e312946d420f8923d283130e5996d44a3 100644 (file)
 <?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
index 3112bbf0706985be6aefb1549e4fcf09ae518fe5..d3870792978a2f0a45ee88ba7c67ed5771355894 100644 (file)
@@ -1,47 +1,63 @@
 <?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
diff --git a/api/v3/examples/Mailing/Submit.php b/api/v3/examples/Mailing/Submit.php
new file mode 100644 (file)
index 0000000..33ab8c7
--- /dev/null
@@ -0,0 +1,120 @@
+<?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
+*/
index 0b9d99b2371fefbc6f3e247eaf960a6864c830f3..47c7b46e7596f86182910d94e35112704220fecb 100644 (file)
@@ -1,58 +1,74 @@
 <?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
index 7e8a2978174edcc852848eed23827822667dabb5..20da77c50329b7f0e22068aa4b0d98d4bfd128c6 100644 (file)
@@ -1,74 +1,90 @@
 <?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
index 47d84cf41e332434894a59411524dd7fb2da79d0..668d14178d6c48ae388b6cd39d17a6abcb37ed9a 100644 (file)
@@ -1,47 +1,63 @@
 <?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
index e59994618e81e1aed19445fa63d797349d2e3efe..5cfe6d21b55ea9dc000c9d510dca39168a8e055f 100644 (file)
@@ -1,66 +1,82 @@
 <?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
index 8fa367659bf0de4082ccf154c0f9ba23e4bb208d..005bf7071a3f33c06f7c4c458a2f2910c99af555 100644 (file)
@@ -1,74 +1,90 @@
 <?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
index 65aa8ded801a580f6f65a450d2575c631ab1aa8a..41c412920e26af6e0f31046837bf0ab4352aff04 100644 (file)
@@ -1,67 +1,84 @@
 <?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
index 61e1f78b77d685e685c35a60be039d234705b18a..165f7a13838af2ed1f52285df1fa8f54d206ddca 100644 (file)
@@ -1,55 +1,71 @@
 <?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
index d2b76b18fecc6e0855138a1da1c3294250fe0644..15b111ef1e340abf9eb543442d6997216def9f8b 100644 (file)
@@ -1,55 +1,71 @@
 <?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
index 2887176e4ea4c9c52f359ed8ce5595a88a014f38..07e1af9570ffc79958797b0bde45b0b8cf3a8682 100644 (file)
@@ -1,66 +1,82 @@
 <?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
index ec82d0db0acdc9be38f94a5c99e40dbfe1c3144d..1c86b6deabc01cd7966f0f4e2d61d5d75a9017f0 100644 (file)
@@ -1,61 +1,77 @@
 <?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
index 9217360662880fd8815d8d04140234cf563647a5..1af9055fb715ad2b555161c962b5492301c7340d 100644 (file)
@@ -1,82 +1,98 @@
 <?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
index 19ffb1bf87c81732816caffbdccd6a79edba7c74..6f3355ffb14f15795f2723055803329b47a4b0f1 100644 (file)
@@ -1,47 +1,63 @@
 <?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
index 120de5de1298321d6207e777f92033726ec5782f..376c772a9205efcbf41773a5b9be3cab18fb5f76 100644 (file)
@@ -1,63 +1,79 @@
 <?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
index 7d499bbdff6964966d85166274d8f429551a04aa..a9e1a335256f858aff9df817083fb0e94254efcb 100644 (file)
@@ -1,67 +1,84 @@
 <?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
index 1c574f1d9b3e18c32aed5b3e5ebbadaa24fcee05..b3cc861b95b5701d8cbb7a2a03a1f2363c4a0f4d 100644 (file)
@@ -1,47 +1,63 @@
 <?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
index 56eaecc772e74cacf1cf290db37357eedc207050..4109f12f4f440b22abae566fa4643ed697347846 100644 (file)
@@ -1,67 +1,84 @@
 <?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
index bf11336252263f091db0efe4cf2ae7d17554a6db..2a6c930c4d302a498450604f002dddfc90a6761b 100644 (file)
@@ -1,64 +1,80 @@
 <?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
index cf0ac6eb83db799c6e870ddaf3803abf0668065b..6595aa15027c93b4ce605deb737d660d5a3a3edc 100644 (file)
@@ -1,47 +1,63 @@
 <?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
index a0fb55c362796af5f96a0238cad0634050ae5960..66b85868e6803cbd39bd224be0091eda761c7b5e 100644 (file)
@@ -1,60 +1,64 @@
 <?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
index 8f799d1f207b848e733f017ad7c15d3b1a8e4392..cf8152692dc09d56cbf5a0fea15595bc5011ff42 100644 (file)
@@ -1,69 +1,85 @@
 <?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
index b75a2f02870b0edef7fdbbfd701d18b312a5eaa9..8cefe8d4fa856f16aca8128e92b7d0385ca85b1b 100644 (file)
@@ -1,47 +1,63 @@
 <?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
index 779bc241724821d5c5f1ff0af6bd2abf22bd5da3..4f786c220a8dd9c3abd34c49aba43d6c6be41dca 100644 (file)
@@ -1,57 +1,73 @@
 <?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
index 0cf8674b6b15fc8b47225ee0cd1ef2ca14800020..9f8a43f7959ffb283e720f305a829c3892e4c3a5 100644 (file)
 <?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
index 49fb663faa420fa425151d99e8ba5d2e27bd580b..d33da0b4940d9a32fb2c29c6c4139df531ef7990 100644 (file)
@@ -1,56 +1,73 @@
 <?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
index 6beb53c113a463f1a08e881b41004effa9b20f4e..c74231c39eb620bf81037ea06334c6a1e25667b4 100644 (file)
@@ -1,75 +1,91 @@
 <?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
index 1f70d8f36e3f4ad5f4281b8944bd24bb482d9d51..8d9eb631219d0cb0d0f30a00665c5d2ce872f7a8 100644 (file)
 <?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
index 7aa04d0e21747d52e58911890f3b185ae80de75d..082f2cb762debf76baa7435d77bdfe301cca9717 100644 (file)
@@ -1,78 +1,94 @@
 <?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
index 788f2b98f739e3974ceaed7ab105c090ce0de15d..b06f437a8a6a704b50acc26bf84b6f38e9dd3249 100644 (file)
 <?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
index 397a255596dc53b6dfcd484674bdc062e7fa13ac..98d30be33638dce015e0ce4d53cb5dab06eb3dba 100644 (file)
 <?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
index e45c9a737a4c2128a113ef15a0cda4887f9eb576..569864723ce835ab60ce77497b2c1da658b86ea0 100644 (file)
@@ -1,55 +1,71 @@
 <?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
index c194956c6a45d76805a7218c6554eb03427bbda0..bf8a2edbca16d4f5f811b6f0012fd1c2e72b6122 100644 (file)
@@ -1,47 +1,63 @@
 <?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
index 87e45e80376fde23fdf1525d78d72122a5171d28..00498b9ec6cd2c57b514ac89cafbadc1b89b495a 100644 (file)
@@ -1,55 +1,71 @@
 <?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
index 0a61f2634717bd82e500cc4616b8796f40dd76ac..b4793cfe9f524570fa7d6f1095b3ab13d1b9afec 100644 (file)
@@ -1,67 +1,83 @@
 <?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
index 74a74ec498a7e79d6c82bc4934a96eb7b1ad5330..d5114cf345eaf6bc6e32a4b1047c6de4c66361d2 100644 (file)
@@ -1,47 +1,63 @@
 <?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
index 0a5c0ed83658d5213066a31cf9532fdc76da4538..8f868c9a939d208e44ac8390766304718aa16066 100644 (file)
@@ -1,67 +1,83 @@
 <?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
index 6891f7f03dde1dc81256a05b9f986c72408dc3f4..1b650449232401b7ca384761f8e0eb8876bc69e4 100644 (file)
@@ -1,75 +1,91 @@
 <?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
index 966f5842bd51812ac372e9d952c36a4c03e3905e..347a451e357f7157f963b4fe0c18b26b120dd04a 100644 (file)
@@ -1,47 +1,63 @@
 <?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
index 1c7ba72fb4c80a86952d89946a3d9ce5b5ac76e5..1db856a0506dd5a984e0ab40f72e56fb7edbdd53 100644 (file)
@@ -1,78 +1,94 @@
 <?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
index 323c678dd7076ea9aefc91809517bfc7b40b8b5d..dddb23984f873be3dc1e2b5acdd78c23cdcd5645 100644 (file)
@@ -1,47 +1,63 @@
 <?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
index 3e5d8f0f110f47c1089fe4371aa90c6469b47e97..538506958b1dcde1bd27165cc8123e26eb6c2ceb 100644 (file)
@@ -1,65 +1,81 @@
 <?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
index a7a49076cb7726313d7aa75cb6b7f45e6e00758f..93fd8553af5694334bd8dc84632adef81146c211 100644 (file)
@@ -1,47 +1,63 @@
 <?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
index df460cf98053daa4aa6e0d8f504ae4db96f685a9..f4ea4f1b4af789f6d54fe63da07a9e1e278c0c4f 100644 (file)
@@ -1,60 +1,76 @@
 <?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
index 82d61298e440fbde4afd3b032be5aa188735b2d2..6b15b7054040ec8afd750107b27429d2918c9026 100644 (file)
 <?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
index 8fa7bab93bad581d758ce58161c298b20e096fba..827ac42f0543062af34fdcfb95902538c247c02b 100644 (file)
@@ -1,50 +1,66 @@
 <?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
index 460ebabdba57877e1dc58f40a89d2c650c31dad3..62fbb4ec395f1c0ba554f26e7a401fc0d0ae996d 100644 (file)
@@ -1,72 +1,88 @@
 <?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
index 2539d81ab6f8b9d5b6b84d3e5dcc4db78267d430..cd07fae578aeb9e77764e2895f8888d4d5bd2fa5 100644 (file)
@@ -1,72 +1,89 @@
 <?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
index 0e02f752501550bfc1ae45ea68c3f8f2acd047da..cbe35a0ea2d1def57340af24802e05120dd5fa29 100644 (file)
@@ -1,65 +1,81 @@
 <?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
index bc0e01003400886a4918129481dd5b125e66fd3b..28801b96100e5441294ada0524e616cba1480731 100644 (file)
@@ -1,50 +1,66 @@
 <?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
index e1e6120eb3b413eb65e5f274a50666995c01ec6b..a526b9c3b741a49ca5f131e86ecaa11462e39c2b 100644 (file)
 <?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
index fe32d3cad8b4b40df3f09f7bde74ed22f9611132..07615b674a409d51f9035b51bc4bb52a5bc8c9e0 100644 (file)
@@ -1,62 +1,78 @@
 <?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
index 0e795d380abf143931a2ba45d5e3386acedf6aa9..2141638b4c60c76da4796103bbcd06b550a150d3 100644 (file)
@@ -1,73 +1,89 @@
 <?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
index 81bf7ded9c5a3c331c2cda5f66933102a72398d2..3f77f4f0be3515d2adeabcb1daec7c60f94c81ac 100644 (file)
@@ -1,47 +1,63 @@
 <?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
index 45a6729bd7f3d8e0f77e68a7e31cba5006841bad..9d72dc87c7e3fb84af121769659f25746e7141f3 100644 (file)
@@ -1,63 +1,79 @@
 <?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
index 7745993d5a8dba3bf9ff2dd97824b7fd28219ace..5ba3272b589f164f71ccbfc71a69938237236a7b 100644 (file)
@@ -1,74 +1,90 @@
 <?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
index 3db747959396e6039028fea4df56b9321dd2329e..cbe7bda4f3b076cced306f20d57c357e8c07b3be 100644 (file)
@@ -1,47 +1,63 @@
 <?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
index 743f7abd2afe300f4464fca1c61d60758ac169bf..da75f61bc6e3dc0f3725434eba844ea60415c891 100644 (file)
@@ -1,61 +1,77 @@
 <?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
index 41257e8f3c203dbba3d16e3a69999e8b0422047d..806c3ee2eb6b62c2246e9c1ff2b531e791832640 100644 (file)
@@ -1,71 +1,89 @@
 <?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
index 71bdf5e5c469805e63f608f70b1316a6c7b5a0b9..f45fad6abaf6ad02fe457772891336130c59bb42 100644 (file)
@@ -1,47 +1,63 @@
 <?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
index 713f077cf4f1a00f2c87d1450f7a6cd4ebecbabc..19d5b0410858a276a56b2ab38fc297e20b57444f 100644 (file)
@@ -1,59 +1,75 @@
 <?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
index 41c8abfe2daa3939c856ffedea94107c448f5465..a650ea8feafe9c8e11213625b08b5c1efd7910d1 100644 (file)
@@ -1,44 +1,60 @@
 <?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,
@@ -48,39 +64,39 @@ function profile_apply_expectedresult(){
       '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
index 1e229acffa7682f1b51a086244e9e8d07410594c..6e22136fb07a442ac47993da7c30ab0354be9548 100644 (file)
 <?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
index 37f5a5890d0cbd583a5792a598d41875318a71d5..35564b56f37013ced48c37b63f9f0f1a26d4b995 100644 (file)
 <?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
index 564522bd8ba9d3912b1d3af73e2b938fa4db802c..3edde79896c448d260b734fbee6a7a92a1fc5501 100644 (file)
 <?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
index 5b89a61fdad478a4ea3e4625884e26dc09439cef..91ba9825916208c1881088c84154e1a2653504f5 100644 (file)
 <?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
index 936f8b84126eb2afa661355c5d3eee576a4e94e2..9205979cd3ca339a0deeb8a67843d7947118c0ef 100644 (file)
@@ -1,68 +1,84 @@
 <?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
index 21495601ac099db400967e1028722892130bd3dc..a5e70535fef693173cf474d12f289f413e508f6a 100644 (file)
@@ -1,47 +1,63 @@
 <?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
index 0802c5a1f0263e94acb1ccef7a3f3be741a2ccd7..9165b6a33c5bb4d6b1d870ff224a893883c4f92b 100644 (file)
@@ -1,62 +1,78 @@
 <?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
index ab995846e25dd1543b5cf172b356c8889a1e9433..db712b577932291887a53b36667a08ea41065925 100644 (file)
@@ -1,75 +1,92 @@
 <?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
index 2ac80828edb8071eb4fa40097b0a4f5d1de6d1f8..fb837467aa2744b3529cdac8f863f3b295bd327a 100644 (file)
@@ -1,65 +1,82 @@
 <?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
index 716e6068adbed7edc209a1d7ca0b7f92514e680d..99e3ae461c566de7cb9c123b2e019ddf59bf9ec3 100644 (file)
@@ -1,75 +1,92 @@
 <?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
index 7ba21e6575e928b955c5db19f963e032397bcef8..8ee1ec860a8da6abc4f3fef8aba5af9f1093f61c 100644 (file)
@@ -1,62 +1,79 @@
 <?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
index 5756dd46c6d6c0b3c345e0281d7b83d034a4d591..b6ba39501dcf53c2f504ae29601bfea5299796ea 100644 (file)
@@ -1,69 +1,85 @@
 <?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
index dd81f5cc01a8aa8db1621dd040238cac8ab6ee43..609b87740c5ce29907e79955e6f9545b3f7e2c82 100644 (file)
@@ -1,47 +1,63 @@
 <?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
index b75584b9d6c51bc691e91d28aa201e2a9d6a98ac..f46d10c63e1edf6be9c9700739f733962b6dccbf 100644 (file)
@@ -1,69 +1,86 @@
 <?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
index 55f412f9a7e6284bf8b9e7ac7f02279275c0c160..14ac786007d92d93361eb56898d3db2852681ee1 100644 (file)
@@ -1,65 +1,72 @@
 <?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
index 7c4c742e4e89460468cbe035d20f056c272cb4fa..c069f335da053f0fbcb6317ce4d0937ca7fc6be7 100644 (file)
@@ -1,53 +1,69 @@
 <?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
index e1e3df2134e0324ec0b8eeddd333b58e761bfb85..11c26b53e6d525df5159cd48552f37bf110b257b 100644 (file)
@@ -1,58 +1,75 @@
 <?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
index 50771cf43fbc24283c49b7ee02572dd5ab9271f3..47121bf6f4813943970be664af45330dde73854c 100644 (file)
@@ -1,52 +1,69 @@
 <?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
index cf69d0bd3ecff71af566abd4af068c796c0c28b0..d0c3c40128abdcbb0a2438eabc8f91eaeae730c9 100644 (file)
@@ -1,58 +1,75 @@
 <?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
index 3a204401615ae1e8f4da3a5ca3c8ddd52ea76bb6..812b9c71e041879fde9618a1ea7afe05027ba031 100644 (file)
@@ -1,53 +1,69 @@
 <?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
index 0a62bf56ed4dd3e3989771b20ec8508cd066c453..311f2b42a8e6c8ee05b7f537c9afeb1af364d837 100644 (file)
@@ -1,58 +1,75 @@
 <?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
index 75c11cf9eaeec67441ac7f0b01068f0218636c7d..689ff05e035538cb9d7c6fa822658596ddd9a907 100644 (file)
@@ -1,57 +1,74 @@
 <?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
index c8d637a766680917a9aef1c42c2071f7a28e912a..ab680d810f070af245393d02c990934880a58e27 100644 (file)
 <?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
index 20317b13b17b2851db279e1b13df297721219351..976149687719fcb8411ec147d096efbf071afde0 100644 (file)
@@ -1,52 +1,69 @@
 <?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
index b112c5bb887d8d4292d8cf78dde296c094af4d18..b4120c781fe42d08caa3fdac80839a5b3b14e525 100644 (file)
@@ -1,60 +1,77 @@
 <?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
index 03c06fe56fb12ab2259f12ef56919c0d8af761d2..7b1d4b8b49c130309c2328473c2464a46016748b 100644 (file)
@@ -1,43 +1,60 @@
 <?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
index 19e4bd7ff6cda768fbbfb3209902026ed14a4661..88e773843cdeb93009435975f358599457ce9621 100644 (file)
@@ -1,63 +1,80 @@
 <?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
index 6ef6402f3029c8d31f16a9467270d934f05b3540..7bf2738db026e8c345a000fc090d186b33364ce6 100644 (file)
@@ -1,68 +1,85 @@
 <?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
index e0fc59ce8c41108df5df83f7f42fc320610d7530..8d9911a86084970c6cf782c35303992a8c3781e9 100644 (file)
@@ -1,74 +1,90 @@
 <?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
index 39e1fd28873e09d8ea16c99be5d50154da6a582a..aad7c169c797a060b5dad3e5044d7a3ebd1d2e7c 100644 (file)
@@ -1,47 +1,63 @@
 <?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
index 40f79b4071cd3f0d029ac1cb0fb67d65f0c3298a..5805d2408ad9c93cd203ad0a1be14c17eed431ae 100644 (file)
@@ -1,64 +1,80 @@
 <?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
index 8f0c63c0f8edc3f2d3d4ad4f728b540287ccbe8a..a18541eebc5de916c9301395e4c8033e85e97bef 100644 (file)
@@ -1,48 +1,64 @@
 <?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
index 4eb8a620a700aa5057fed9c005e4e5828d31f6d6..b29aa1c3ce42cc4e7a752a2066a7da2dd6f11322 100644 (file)
@@ -1,45 +1,62 @@
 <?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
index f1fa7b5341a3ef82697752cac94987d480d39c97..a0feec3427066905f30139d1f2b2963924d388e8 100644 (file)
@@ -1,62 +1,78 @@
 <?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
index 68914b444cf2c6bd0dc9c18294a7a8ca4fb21202..0b83a92fb93ff68d8525562097c9b1f278531775 100644 (file)
@@ -1,47 +1,63 @@
 <?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
index 2dafb49ee03e10a54fad52ae6aa4996f6a52e3ac..8d4dd1ebfe07c99539c19365dc332a1c32977954 100644 (file)
@@ -1,60 +1,76 @@
 <?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
index 7b645eb8366c78eacd6222e5cbdde7888d801d41..1ad846887a2dab3c67780902212148bfe27ef684 100644 (file)
@@ -1,64 +1,81 @@
 <?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
index a329f22002211b4936f62691a14b14e4f2f7bfac..a8f0f58676a0cc7753173e13b26758c646fd1d1d 100644 (file)
 <?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
index f582388a43836de0aa83398273f94440e558eb3b..7292413b0d077414db4a43f4fdd624c3ab3519b6 100644 (file)
@@ -1,57 +1,74 @@
 <?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
diff --git a/api/v3/examples/TaxContributionPage/Create.php b/api/v3/examples/TaxContributionPage/Create.php
new file mode 100644 (file)
index 0000000..8b8bb96
--- /dev/null
@@ -0,0 +1,118 @@
+<?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
+*/
diff --git a/api/v3/examples/TaxContributionPage/CreateWithNestedLineItems.php b/api/v3/examples/TaxContributionPage/CreateWithNestedLineItems.php
new file mode 100644 (file)
index 0000000..6a2645e
--- /dev/null
@@ -0,0 +1,193 @@
+<?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
+*/
diff --git a/api/v3/examples/TaxContributionPage/Delete.php b/api/v3/examples/TaxContributionPage/Delete.php
new file mode 100644 (file)
index 0000000..9aa32a0
--- /dev/null
@@ -0,0 +1,80 @@
+<?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
+*/
index 701f005699b1f7f5136dd14830a0c7161b382f99..4574229cfeeed0573a573d02b4525ee547bf9b00 100644 (file)
@@ -1,79 +1,95 @@
 <?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
index b93207b15c8869d3356331eca331dfb874c9769b..5855bbf3a128c03f66c510eea5f318cf05028965 100644 (file)
@@ -1,47 +1,63 @@
 <?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
index 2395dc93d1b1c92925d63d745dcdc98ab3078f97..b75acb02659a66b4ee35ae72ac027c32db015d38 100644 (file)
@@ -1,64 +1,80 @@
 <?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
index 0a162cc200bdf5305077a2fbb46015351adeda26..603db802076d85e5f6b33891b8573a03cf3d26e7 100644 (file)
 <?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
index 6458ffd03ff0ab849a6fb87ebcbe5d7f84eb872c..52d4675a5c5397209df002f9bb937ddb106a168b 100644 (file)
 <?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
index 7c11095bfe2b4bf81620c6d09f40bda029aaf710..f909a776b5c01e8aad2bf4787705ed5d997d9e24 100644 (file)
@@ -1,47 +1,63 @@
 <?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
index 9711d93470ac3d379741d275534d138a19ff704c..5a2aab584aad5a67c896d43d936a0825be2807e1 100644 (file)
@@ -1,73 +1,89 @@
 <?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
index 5eaba20a6e99259aec363080267675f0b1fddd40..22ba41dca05ff33b67d0a249c4390230278fbdee 100644 (file)
@@ -1,65 +1,81 @@
 <?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
index d56f3261296556d7374e83a8de12b7305d183a07..13039bbe1a1efc7dfaa42614141810049fc70e46 100644 (file)
@@ -1,60 +1,76 @@
 <?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
index ca93d3f382eeae9e03cd525811cc4c8e0dc291a8..a725941e2fd15ad10292f49a9907a794ae0ac904 100644 (file)
@@ -1,55 +1,71 @@
 <?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
index b490c1707fa7f9dba132b2ab8ee31c59f17ab25b..80d91694cb9e8e12077eef39ab338b97adfd3329 100644 (file)
@@ -1,57 +1,73 @@
 <?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
index 75daecd2eb16a1e7b2c73c0387deebd55b6aa864..f5febfdd8e6016b26f6bc74fd496e92b7244051c 100644 (file)
@@ -1,47 +1,63 @@
 <?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
index 7b98281ea65db2a8ceab9cde3b2419370150d674..e3475fd4603d55dc3db57ff3fc734a1b486524b3 100644 (file)
@@ -1,57 +1,73 @@
 <?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
index bd16132d6b1ce52ce5015beee39fc4ddbf9fa17c..5b945173f1b80a6109674096d794f107a659ee3d 100644 (file)
 <?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
index 3ed1be650c4b6e3876e2a6e45993afe1d60e78da..e7f2857c6524a0637ecdd7bb41ca283fcbcb5810 100644 (file)
 <?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