REST_Submissions_Controller::get_item_schema()

Retrieves the model’s schema, conforming to JSON Schema.

Description

Return

(array) Model schema data.

Source

File: src/db-objects/submissions/rest-submissions-controller.php

	public function get_item_schema() {
		$schema = parent::get_item_schema();

		$schema['properties']['form_id'] = array(
			'description' => __( 'ID of the form this submission belongs to.', 'torro-forms' ),
			'type'        => 'integer',
			'minimum'     => 1,
			'context'     => array( 'view', 'edit', 'embed' ),
			'arg_options' => array(
				'minimum' => 1,
			),
		);

		$schema['properties']['user_id'] = array(
			'description' => __( 'ID of the user this submission belongs to, if any.', 'torro-forms' ),
			'type'        => 'integer',
			'minimum'     => 0,
			'context'     => array( 'view', 'edit', 'embed' ),
			'arg_options' => array(
				'minimum' => 0,
			),
		);

		$schema['properties']['timestamp'] = array(
			'description' => __( 'UNIX timestamp for when the submission was created.', 'torro-forms' ),
			'type'        => 'integer',
			'context'     => array( 'view', 'edit', 'embed' ),
		);

		$schema['properties']['remote_addr'] = array(
			'description' => __( 'IP address of who created the submission.', 'torro-forms' ),
			'type'        => 'string',
			'context'     => array( 'view', 'edit', 'embed' ),
		);

		$schema['properties']['user_key'] = array(
			'description' => __( 'Key of who created the submission.', 'torro-forms' ),
			'type'        => 'string',
			'context'     => array( 'view', 'edit', 'embed' ),
		);

		$schema['properties']['status'] = array(
			'description' => __( 'Status of the submission.', 'torro-forms' ),
			'type'        => 'string',
			'enum'        => array( 'completed', 'progressing' ),
			'context'     => array( 'view', 'edit', 'embed' ),
		);

		return $schema;
	}

Changelog

Changelog
Version Description
1.0.0 Introduced.