LLMS_REST_Enrollments_Controller::get_item_schema_base()
Get the Enrollments’s schema, conforming to JSON Schema.
Return Return
(array)
Source Source
File: libraries/lifterlms-rest/includes/server/class-llms-rest-enrollments-controller.php
protected function get_item_schema_base() {
$schema = array(
'$schema' => 'http://json-schema.org/draft-04/schema#',
'title' => 'students-enrollments',
'type' => 'object',
'properties' => array(
'post_id' => array(
'description' => __( 'The ID of the course/membership.', 'lifterlms' ),
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'student_id' => array(
'description' => __( 'The ID of the student.', 'lifterlms' ),
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'date_created' => array(
'description' => __( 'Creation date. Format: `Y-m-d H:i:s`', 'lifterlms' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
),
'date_updated' => array(
'description' => __( 'Date last modified. Format: `Y-m-d H:i:s`', 'lifterlms' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'status' => array(
'description' => __( 'The status of the enrollment.', 'lifterlms' ),
'enum' => array_keys( llms_get_enrollment_statuses() ),
'context' => array( 'view', 'edit' ),
'type' => 'string',
),
'trigger' => array(
'description' => __( 'The enrollment trigger. Default is `any`.', 'lifterlms' ),
'context' => array( 'view', 'edit' ),
'type' => 'string',
'default' => 'any',
'readonly' => true,
),
),
);
$object_type = $this->get_object_type( $schema );
/**
* Filter item schema for the enrollments controller.
*
* @since 1.0.0-beta.10
* @deprecated 1.0.0-beta.27
*
* @param array $schema Item schema data.
*/
return apply_filters_deprecated(
'llms_rest_enrollments_item_schema',
array( $schema ),
'[version]',
"llms_rest_{$this->get_object_type( $schema )}_item_schema"
);
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 1.0.0-beta.27 | Introduced. |