Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

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