Moodle PHP Documentation 4.3
Moodle 4.3.5 (Build: 20240610) (7dcfaa79f78)
core_reportbuilder\local\helpers\schedule Class Reference

Static Public Member Functions

static calculate_next_send_time (model $schedule, ?int $timenow=null)
 Calculate the next time a schedule should be sent, based on it's recurrence and when it was initially scheduled.
 
static create_schedule (stdClass $data, ?int $timenow=null)
 Create report schedule, calculate when it should be next sent.
 
static delete_schedule (int $reportid, int $scheduleid)
 Delete report schedule.
 
static get_format_options ()
 Return list of available data formats.
 
static get_recurrence_options ()
 Return list of recurrence options.
 
static get_report_empty_options ()
 Return list of options for when report is empty.
 
static get_schedule_report_count (model $schedule)
 Return count of schedule report rows.
 
static get_schedule_report_file (model $schedule)
 Generate stored file instance for given schedule, in user draft.
 
static get_schedule_report_users (model $schedule)
 Return array of users who match the audience records added to the given schedule.
 
static get_viewas_options ()
 Return list of available view as user options.
 
static send_schedule_message (model $schedule, stdClass $user, stored_file $attachment)
 Send schedule message to user.
 
static should_send_schedule (model $schedule)
 Check whether given schedule needs to be sent.
 
static toggle_schedule (int $reportid, int $scheduleid, bool $enabled)
 Toggle report schedule enabled.
 
static update_schedule (stdClass $data)
 Update report schedule.
 

Member Function Documentation

◆ calculate_next_send_time()

static core_reportbuilder\local\helpers\schedule::calculate_next_send_time ( model $schedule,
?int $timenow = null )
static

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

Parameters
model$schedule
int | null$timenowTime to use as comparison against current date (defaults to current time)
Return values
int

◆ create_schedule()

static core_reportbuilder\local\helpers\schedule::create_schedule ( stdClass $data,
?int $timenow = null )
static

Create report schedule, calculate when it should be next sent.

Parameters
stdClass$data
int | null$timenowTime to use as comparison against current date (defaults to current time)
Return values
model

◆ delete_schedule()

static core_reportbuilder\local\helpers\schedule::delete_schedule ( int $reportid,
int $scheduleid )
static

Delete report schedule.

Parameters
int$reportid
int$scheduleid
Return values
bool
Exceptions
invalid_parameter_exception

◆ get_format_options()

static core_reportbuilder\local\helpers\schedule::get_format_options ( )
static

Return list of available data formats.

Return values
string[]

◆ get_recurrence_options()

static core_reportbuilder\local\helpers\schedule::get_recurrence_options ( )
static

Return list of recurrence options.

Return values
string[]

◆ get_report_empty_options()

static core_reportbuilder\local\helpers\schedule::get_report_empty_options ( )
static

Return list of options for when report is empty.

Return values
string[]

◆ get_schedule_report_count()

static core_reportbuilder\local\helpers\schedule::get_schedule_report_count ( model $schedule)
static

Return count of schedule report rows.

Parameters
model$schedule
Return values
int

◆ get_schedule_report_file()

static core_reportbuilder\local\helpers\schedule::get_schedule_report_file ( model $schedule)
static

Generate stored file instance for given schedule, in user draft.

Parameters
model$schedule
Return values
stored_file

◆ get_schedule_report_users()

static core_reportbuilder\local\helpers\schedule::get_schedule_report_users ( model $schedule)
static

Return array of users who match the audience records added to the given schedule.

Parameters
model$schedule
Return values
stdClass[]

◆ get_viewas_options()

static core_reportbuilder\local\helpers\schedule::get_viewas_options ( )
static

Return list of available view as user options.

Return values
string[]

◆ send_schedule_message()

static core_reportbuilder\local\helpers\schedule::send_schedule_message ( model $schedule,
stdClass $user,
stored_file $attachment )
static

Send schedule message to user.

Parameters
model$schedule
stdClass$user
stored_file$attachment
Return values
bool

◆ should_send_schedule()

static core_reportbuilder\local\helpers\schedule::should_send_schedule ( model $schedule)
static

Check whether given schedule needs to be sent.

Parameters
model$schedule
Return values
bool

◆ toggle_schedule()

static core_reportbuilder\local\helpers\schedule::toggle_schedule ( int $reportid,
int $scheduleid,
bool $enabled )
static

Toggle report schedule enabled.

Parameters
int$reportid
int$scheduleid
bool$enabled
Return values
bool
Exceptions
invalid_parameter_exception

◆ update_schedule()

static core_reportbuilder\local\helpers\schedule::update_schedule ( stdClass $data)
static

Update report schedule.

Parameters
stdClass$data
Return values
model
Exceptions
invalid_parameter_exception

The documentation for this class was generated from the following file: