Form_Frontend_Submission_Handler::create_new_submission( awsmug\Torro_Forms\DB_Objects\Forms\Form $form, array $data )

Creates a new submission object.

Description

Parameters

$form

(awsmug\Torro_Forms\DB_Objects\Forms\Form) (Required) Form object.

$data

(array) (Required) Submission POST data.

Return

(awsmug\Torro_Forms\DB_Objects\Submissions\Submission) New submission object.

Source

File: src/db-objects/forms/form-frontend-submission-handler.php

	protected function create_new_submission( $form, $data ) {
		$submission = $this->form_manager->get_child_manager( 'submissions' )->create();

		/**
		 * Fires when a new submission object has just been instantiated.
		 *
		 * This hook may be used to set additional unique data on a submission.
		 *
		 * @since 1.0.0
		 *
		 * @param Submission $submission Submission object.
		 * @param Form       $form       Form object.
		 * @param array      $data       Submission POST data.
		 */
		do_action( "{$this->form_manager->get_prefix()}create_new_submission", $submission, $form, $data );

		return $submission;
	}

Changelog

Changelog
Version Description
1.0.0 Introduced.