Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 401 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.

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

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

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

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

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

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