You are here

public function WebformSubmissionLogManager::insert in Webform 6.x

Same name and namespace in other branches
  1. 8.5 modules/webform_submission_log/src/WebformSubmissionLogManager.php \Drupal\webform_submission_log\WebformSubmissionLogManager::insert()

Insert submission log.

Parameters

array $fields: An associative array of fields to be inserted into the submission log.

Overrides WebformSubmissionLogManagerInterface::insert

File

modules/webform_submission_log/src/WebformSubmissionLogManager.php, line 39

Class

WebformSubmissionLogManager
Webform submission log manager.

Namespace

Drupal\webform_submission_log

Code

public function insert(array $fields) {
  $fields += [
    'webform_id' => '',
    'sid' => '',
    'handler_id' => '',
    'operation' => '',
    'uid' => '',
    'message' => '',
    'variables' => serialize([]),
    'data' => serialize([]),
    'timestamp' => '',
  ];
  $this->database
    ->insert(WebformSubmissionLogManagerInterface::TABLE)
    ->fields($fields)
    ->execute();
}