Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Differences Between: [Versions 400 and 403]

Class for loading/storing data requests from the DB.

Copyright: 2018 Jun Pataleta
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 304 lines (10 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

data_request:: (7 methods):
  define_properties()
  is_expired()
  get_expired_requests()
  expire()
  is_resettable()
  is_active()
  resubmit_request()


Class: data_request  - X-Ref

Class for loading/storing data requests from the DB.

define_properties()   X-Ref
Return the definition of the properties of this model.

return: array

is_expired(data_request $request)   X-Ref
Determines whether a completed data export request has expired.
The response will be valid regardless of the expiry scheduled task having run.

return: bool true if the request has expired.
param: data_request $request the data request object whose expiry will be checked.

get_expired_requests($userid = 0)   X-Ref
Fetch completed data requests which are due to expire.

return: array Details of completed requests which are due to expire.
param: int $userid Optional user ID to filter by.

expire($expiredrequests)   X-Ref
Expire a given set of data requests.
Update request status and delete the files.

return: void
param: array $expiredrequests [requestid => userid]

is_resettable()   X-Ref
Whether this request is in a state appropriate for reset/resubmission.

Note: This does not check whether any other completed requests exist for this user.

return: bool

is_active()   X-Ref
Whether this request is 'active'.

return: bool

resubmit_request()   X-Ref
Reject this request and resubmit it as a fresh request.

Note: This does not check whether any other completed requests exist for this user.

return: self