You are here

public function Submission::save in Little helpers 7.2

Insert or update this submission.

File

src/Webform/Submission.php, line 216

Class

Submission
A useful wrapper for webform submission objects.

Namespace

Drupal\little_helpers\Webform

Code

public function save() {

  // These need to be done with the naked submission object otherwise
  // drupal_write_record() will ignore all magic properties because it uses
  // propert_exists() to check for them.
  if (!empty($this->submission->sid)) {
    webform_submission_update($this->node, $this->submission);
  }
  else {
    webform_submission_insert($this->node, $this->submission);
  }
}