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 401] [Versions 400 and 402] [Versions 400 and 403]

(no description)

File Size: 397 lines (14 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: schedule  - X-Ref

Helper class for report schedule related methods

create_schedule(stdClass $data, ?int $timenow = null)   X-Ref
Create report schedule, calculate when it should be next sent

return: model
param: stdClass $data
param: int|null $timenow Time to use as comparison against current date (defaults to current time)

update_schedule(stdClass $data)   X-Ref
Update report schedule

return: model
param: stdClass $data

toggle_schedule(int $reportid, int $scheduleid, bool $enabled)   X-Ref
Toggle report schedule enabled

return: bool
param: int $reportid
param: int $scheduleid
param: bool $enabled

get_schedule_report_users(model $schedule)   X-Ref
Return array of users who match the audience records added to the given schedule

return: stdClass[]
param: model $schedule

get_schedule_report_count(model $schedule)   X-Ref
Return count of schedule report rows

return: int
param: model $schedule

get_schedule_report_file(model $schedule)   X-Ref
Generate stored file instance for given schedule, in user draft

return: stored_file
param: model $schedule

should_send_schedule(model $schedule)   X-Ref
No description

calculate_next_send_time(model $schedule, ?int $timenow = null)   X-Ref
Calculate the next time a schedule should be sent, based on it's recurrence and when it was initially scheduled. Ensures
returned value is after the current date

return: int
param: model $schedule
param: int|null $timenow Time to use as comparison against current date (defaults to current time)

send_schedule_message(model $schedule, stdClass $user, stored_file $attachment)   X-Ref
Send schedule message to user

return: bool
param: model $schedule
param: stdClass $user
param: stored_file $attachment

delete_schedule(int $reportid, int $scheduleid)   X-Ref
Delete report schedule

return: bool
param: int $reportid
param: int $scheduleid

get_format_options()   X-Ref
Return list of available data formats

return: string[]

get_viewas_options()   X-Ref
Return list of available view as user options

return: string[]

get_recurrence_options()   X-Ref
Return list of recurrence options

return: string[]

get_report_empty_options()   X-Ref
Return list of options for when report is empty

return: string[]