protected function HubspotWebformHandler::getPostData in HubSpot 3.x
Same name and namespace in other branches
- 8 src/Plugin/WebformHandler/HubspotWebformHandler.php \Drupal\hubspot\Plugin\WebformHandler\HubspotWebformHandler::getPostData()
Get a webform submission's post data.
Parameters
string $operation: The type of webform submission operation to be posted. Can be 'insert', 'update', or 'delete'.
\Drupal\webform\WebformSubmissionInterface $webform_submission: The webform submission to be posted.
Return value
array A webform submission converted to an associative array.
1 call to HubspotWebformHandler::getPostData()
- HubspotWebformHandler::remotePost in src/
Plugin/ WebformHandler/ HubspotWebformHandler.php - Execute a remote post.
File
- src/
Plugin/ WebformHandler/ HubspotWebformHandler.php, line 832
Class
- HubspotWebformHandler
- Webform submission remote post handler.
Namespace
Drupal\hubspot\Plugin\WebformHandlerCode
protected function getPostData($operation, WebformSubmissionInterface $webform_submission) {
// Get submission and elements data.
$data = $webform_submission
->toArray(TRUE);
// Flatten data.
// Prioritizing elements before the submissions fields.
$data = $data['data'] + $data;
unset($data['data']);
return $data;
}