Merge pull request #2287 from pradpnayak/CRM-13848
[civicrm-core.git] / api / v3 / Profile.php
index c344138390fee8c748b4f4a3e6f50dc278c9f127..d57751b1924dc5c67163cea2d982e38a916aa04f 100644 (file)
@@ -249,7 +249,7 @@ function civicrm_api3_profile_submit($params) {
     $tags = $profileParams['tag'];
     unset($profileParams['tag']);
   }
-  
+
   return civicrm_api3('contact', 'create', $profileParams);
 
   $ufGroupDetails = array();
@@ -386,6 +386,10 @@ function civicrm_api3_profile_apply($params) {
  *
  *  Note that that since the existing code for deriving a blank profile is not easily accessible our
  *  interim solution is just to return an empty array
+ *
+ * @param $params
+ *
+ * @return array
  */
 function _civicrm_api3_profile_getbillingpseudoprofile(&$params) {
 
@@ -527,6 +531,7 @@ function _civicrm_api3_buildprofile_submitfields($profileID, $optionsBehaviour =
       'soft_credit' => 'soft_credit_to',
       'group' => 'group_id',
       'tag' => 'tag_id',
+      'soft_credit_type' => 'soft_credit_type_id',
     );
 
     if(array_key_exists($ufFieldTaleFieldName, $hardCodedEntityFields)) {
@@ -595,10 +600,14 @@ function _civicrm_api3_buildprofile_submitfields($profileID, $optionsBehaviour =
 function _civicrm_api3_order_by_weight($a, $b) {
   return CRM_Utils_Array::value('weight', $b) < CRM_Utils_Array::value('weight', $a) ? TRUE : FALSE;
 }
+
 /**
  * Here we map the profile fields as stored in the uf_field table to their 'real entity'
  * we also return the profile fieldname
  *
+ * @param $field
+ *
+ * @return array
  */
 function _civicrm_api3_map_profile_fields_to_entity(&$field) {
   $entity = $field['field_type'];
@@ -654,6 +663,7 @@ function _civicrm_api3_map_profile_fields_to_entity(&$field) {
     'check_number' => 'contribution',
     'contribution_status_id' => 'contribution',
     'soft_credit' => 'contribution',
+    'soft_credit_type' => 'contribution_soft',
     'group' => 'group_contact',
     'tag' => 'entity_tag',
    );