Submissions

Retrieving the Submission Model

<?php
// Returns an Submission Model for Submission ID 1
Ninja_Forms()->form()->sub( 1 )->get();
// Returns an Submission Model for Submission ID 1
Ninja_Forms()->form()->get_sub( 1 );
// Returns an array of Submission Models for Form ID 1
Ninja_Forms()->form( 1 )->get_subs();

view raw
submission.php
hosted with ❤ by GitHub

Interacting with the Submissions Model

<?php
// Get the ID for a Model
$id = $sub->get_id();
// Get a single value for a Submission by field.
$field_value = $sub->get_field_value( $field_key );
// Get all values for a Submission
$field_values = $sub->get_field_values();
// Get extra data stored with a submission.
$more_data = $sub->get_extra_value( 'more_data' );
// Update a single value for a Submission and save
$sub->update_field_value( $field_key, $new_value )->save();
// Update an array of values for a Submission and save
$sub->update_field_values( $new_values )->save();
// Delete a Submission
$sub->delete();
// Save changes to a Submission
$sub->save();