| @@ -1,10 +1,12 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | namespace BitCode\BitForm\Core\Integration\Hubspot; |
| 4 | 4 | |
| 5 | -class Common { | |
| 6 | - public static function formFldMapping($dataFinal, $fieldMap, $data, $type = '') { | |
| 5 | +class Common | |
| 6 | +{ | |
| 7 | + public static function formFldMapping($dataFinal, $fieldMap, $data, $type = '') | |
| 8 | + { | |
| 7 | 9 | foreach ($fieldMap as $value) { |
| 8 | 10 | $triggerValue = $value->formField; |
| 9 | 11 | $actionValue = $value->hubspotField; |
| 10 | 12 | if ('custom' === $triggerValue) { |
| @@ -24,9 +26,10 @@ | ||
| 24 | 26 | } |
| 25 | 27 | return $dataFinal; |
| 26 | 28 | } |
| 27 | 29 | |
| 28 | - public static function customFldMapping($type, $action, $integrationDetails, $data) { | |
| 30 | + public static function customFldMapping($type, $action, $integrationDetails, $data) | |
| 31 | + { | |
| 29 | 32 | $customFields = self::customFields(); |
| 30 | 33 | foreach ($customFields[$type] as $key => $name) { |
| 31 | 34 | if (property_exists($action, $name)) { |
| 32 | 35 | $data[$key] = $integrationDetails->{$name}; |
| @@ -34,9 +37,10 @@ | ||
| 34 | 37 | } |
| 35 | 38 | return $data; |
| 36 | 39 | } |
| 37 | 40 | |
| 38 | - public static function customFields() { | |
| 41 | + public static function customFields() | |
| 42 | + { | |
| 39 | 43 | return [ |
| 40 | 44 | 'lead' => [ |
| 41 | 45 | 'hs_lead_status' => 'lead_status', |
| 42 | 46 | 'lifecyclestage' => 'lifecycle_stage', |