LLMS_REST_Enrollments_Controller
Description Description
Source Source
File: libraries/lifterlms-rest/includes/server/class-llms-rest-enrollments-controller.php
Changelog Changelog
Version | Description |
---|---|
1.0.0-beta.7 | prepare_objects_query() renamed to prepare_collection_query_args() . prepare_object_query() renamed to prepare_object_query_args() . Added: get_objects_from_query() , prepare_objects_query() , get_pagination_data_from_query() , prepare_collection_items_for_response() methods overrides. get_items() method removed, now abstracted in LLMS_REST_Controller. Fixed description of the post_id path parameter. |
1.0.0-beta.4 | Everybody who can view the enrollment's student can list the enrollments although the single enrollment permission will be checked in LLMS_REST_Enrollments_Controller::get_objects() . The single enrollment can be read only by who can view the enrollment's student. Enrollment's post_id and student_id casted to integer, and fix calling to some undefined functions. |
1.0.0-beta.3 | Don't output "Last" page link header on the last page. |
1.0.0-beta.14 | Update prepare_links() to accept a second parameter, WP_REST_Request . |
1.0.0-beta.12 | Updated $this->prepare_collection_query_args() to reflect changes in the parent class. |
1.0.0-beta.10 | Added trigger property and as param for creation/update/and deletion requests. Added get_endpoint_args_for_item_schema() method override. Use backticks in args and item schema properties descriptions where convenient. Filter prepared enrollment for response in order to include only fields available for response. Added llms_rest_enrollments_item_schema , llms_rest_prepare_enrollment_object_response , llms_rest_enrollment_links filter hooks. Also fix return when the enrollment to be deleted doesn't exist. Fixed 'context' query parameter schema. |
1.0.0-beta.1 | Introduced. |
Methods Methods
- __construct — Constructor.
- build_collection_params — Build the query params for the objects collection.
- check_create_permission — Checks if an enrollment can be edited.
- check_delete_permission — Checks if an enrollment can be deleted
- check_read_permission — Checks if an enrollment can be read.
- check_update_permission — Checks if an enrollment can be updated
- create_item — Creates a single enrollment.
- create_item_permissions_check — Check if a given request has access to create an item.
- delete_item — Deletes a single llms post.
- delete_item_permissions_check — Check if a given request has access to delete an item.
- enrollment_exists — Check enrollment existence.
- get_collection_params — Retrieves the query params for the objects collection.
- get_endpoint_args_for_item_schema — Retrieves an array of endpoint arguments from the item schema for the controller.
- get_item — Get a single item.
- get_item_permissions_check — Check if a given request has access to read an item.
- get_item_schema — Get the Enrollments's schema, conforming to JSON Schema.
- get_items — Get a collection of enrollments.
- get_items_permissions_check — Check if a given request has access to read items.
- get_object — Get object.
- get_objects_from_query — Retrieve an array of objects from the result of $this->get_objects_query().
- get_objects_query — Get enrollments query
- get_pagination_data_from_query — Retrieve pagination information from an objects query.
- handle_creation_date_update — Handles the enrollment creation date.
- handle_status_update — Handles the enrollment status update.
- prepare_collection_items_for_response — Prepare collection items for response.
- prepare_collection_query_args — Prepare enrollments objects query
- prepare_items_query — Determines the allowed query_vars for a get_items() response and prepares them for WP_Query.
- prepare_links — Prepare enrollments links for the request.
- prepare_object_for_response — Prepare a single object output for response.
- prepare_object_query_args — Prepare enrollments objects query.
- register_routes — Register routes.
- set_collection_params — Retrieves the query params for the objects collection.
- update_item — Update item.
- update_item_permissions_check — Check if a given request has access to update an item.