Submission::get_next_container()

Returns the next container for the submission, if there is one.

Description

See also

Return

(awsmug\Torro_Forms\DB_Objects\Containers\Container|null) Next container, or null if there is none.

Source

File: src/db-objects/submissions/submission.php

	public function get_next_container() {
		$container = $this->get_current_container();
		if ( ! $container ) {
			return null;
		}

		$form = $this->get_form();
		if ( ! $form ) {
			return null;
		}

		$container_collection = $form->get_containers( array(
			'number'        => 1,
			'sort'          => array(
				'greater_than' => $container->sort,
			),
			'orderby'       => array(
				'sort' => 'ASC',
			),
			'no_found_rows' => true,
		) );
		if ( 1 > count( $container_collection ) ) {
			return null;
		}

		return $container_collection[0];
	}

Changelog

Changelog
Version Description
1.0.0 Introduced.