Moodle PHP Documentation 4.3
Moodle 4.3.5 (Build: 20240610) (7dcfaa79f78)
tool_brickfield\scheduler Class Reference

Public Member Functions

 __construct (int $instanceid=0, int $contextlevel=CONTEXT_COURSE)
 Scheduler constructor.
 
 create_schedule ()
 Request this schedule object be added.
 
 delete_schedule ()
 Request this schedule object be deleted.
 
 get_datarecord (int $status=self::STATUS_NOT_REQUESTED)
 Create and return a datarecord object for the data table.
 
 is_analyzed ()
 Return true if this schedule object has been analyzed.
 
 is_in_schedule ()
 Return true if this schedule object is in the schedule.
 
 is_scheduled ()
 Return true if this schedule object has been requested to be analyzed.
 
 is_submitted ()
 Return true if this schedule object has been submitted.
 
 mark_analyzed ()
 Mark this schedule object as analyzed.
 
 request_analysis ()
 Request this schedule object to be analyzed.
 

Static Public Member Functions

static create_course_schedule (int $courseid)
 Request the specified course be added.
 
static delete_course_schedule (int $courseid)
 Delete the specified course from the schedule.
 
static initialize_schedule (int $contextlevel=CONTEXT_COURSE)
 Load all requested context types into the schedule as requested.
 
static is_course_analyzed (int $courseid)
 Return true if the specified course has been analyzed.
 
static is_course_in_schedule (int $courseid)
 Return true if the specified course is in the schedule.
 
static is_course_scheduled (int $courseid)
 Return true if the specified course is scheduled.
 
static process_scheduled_requests ()
 Process all the course analysis requests, and mark them as analyzed.
 
static request_course_analysis (int $courseid)
 Request the specified course be analyzed.
 

Public Attributes

int $contextlevel
 $contextlevel The context level of the instance id e.g.
 
int $instanceid
 $instanceid The specific instance id of the context e.g.
 
const DATA_TABLE = 'tool_brickfield_schedule'
 The data table used by the scheduler.
 
const STATUS_NOT_REQUESTED = 0
 Analysis has not been requested.
 
const STATUS_REQUESTED = 1
 Analysis has been requested but not submitted.
 
const STATUS_SUBMITTED = 2
 Analysis has been submitted.
 

Protected Member Functions

 get_contextid ()
 Get the context id for the specified context level and instance.
 
 standard_search_params ()
 The nornal data parameters to search for.
 

Constructor & Destructor Documentation

◆ __construct()

tool_brickfield\scheduler::__construct ( int $instanceid = 0,
int $contextlevel = CONTEXT_COURSE )

Scheduler constructor.

Parameters
int$instanceid
int$contextlevel

Member Function Documentation

◆ create_course_schedule()

static tool_brickfield\scheduler::create_course_schedule ( int $courseid)
static

Request the specified course be added.

Parameters
int$courseid
Return values
bool

◆ create_schedule()

tool_brickfield\scheduler::create_schedule ( )

Request this schedule object be added.

Return true if already added, or the status of the insert operation.

Return values
bool

◆ delete_course_schedule()

static tool_brickfield\scheduler::delete_course_schedule ( int $courseid)
static

Delete the specified course from the schedule.

Parameters
int$courseid
Return values
bool

◆ delete_schedule()

tool_brickfield\scheduler::delete_schedule ( )

Request this schedule object be deleted.

Return values
bool

◆ get_contextid()

tool_brickfield\scheduler::get_contextid ( )
protected

Get the context id for the specified context level and instance.

Return values
int
Exceptions
dml_exception

◆ get_datarecord()

tool_brickfield\scheduler::get_datarecord ( int $status = self::STATUS_NOT_REQUESTED)

Create and return a datarecord object for the data table.

Parameters
int$status
Return values
stdClass
Exceptions
dml_exception

◆ initialize_schedule()

static tool_brickfield\scheduler::initialize_schedule ( int $contextlevel = CONTEXT_COURSE)
static

Load all requested context types into the schedule as requested.

Write records in groups of 100.

Parameters
int$contextlevel
Return values
bool
Exceptions
coding_exception
dml_exception

◆ is_analyzed()

tool_brickfield\scheduler::is_analyzed ( )

Return true if this schedule object has been analyzed.

Return values
bool

◆ is_course_analyzed()

static tool_brickfield\scheduler::is_course_analyzed ( int $courseid)
static

Return true if the specified course has been analyzed.

Parameters
int$courseid
Return values
bool

◆ is_course_in_schedule()

static tool_brickfield\scheduler::is_course_in_schedule ( int $courseid)
static

Return true if the specified course is in the schedule.

Parameters
int$courseid
Return values
bool

◆ is_course_scheduled()

static tool_brickfield\scheduler::is_course_scheduled ( int $courseid)
static

Return true if the specified course is scheduled.

Parameters
int$courseid
Return values
bool

◆ is_in_schedule()

tool_brickfield\scheduler::is_in_schedule ( )

Return true if this schedule object is in the schedule.

Return values
bool

◆ is_scheduled()

tool_brickfield\scheduler::is_scheduled ( )

Return true if this schedule object has been requested to be analyzed.

Return values
bool

◆ is_submitted()

tool_brickfield\scheduler::is_submitted ( )

Return true if this schedule object has been submitted.

Return values
bool

◆ mark_analyzed()

tool_brickfield\scheduler::mark_analyzed ( )

Mark this schedule object as analyzed.

Return values
bool
Exceptions
dml_exception

◆ process_scheduled_requests()

static tool_brickfield\scheduler::process_scheduled_requests ( )
static

Process all the course analysis requests, and mark them as analyzed.

Limit the number of requests processed by time.

Exceptions
ReflectionException
dml_exception

◆ request_analysis()

tool_brickfield\scheduler::request_analysis ( )

Request this schedule object to be analyzed.

Create the schedule if not present.

Return values
bool

◆ request_course_analysis()

static tool_brickfield\scheduler::request_course_analysis ( int $courseid)
static

Request the specified course be analyzed.

Parameters
int$courseid
Return values
bool

◆ standard_search_params()

tool_brickfield\scheduler::standard_search_params ( )
protected

The nornal data parameters to search for.

Return values
array

Member Data Documentation

◆ $contextlevel

int tool_brickfield\scheduler::$contextlevel

$contextlevel The context level of the instance id e.g.

CONTEXT_COURSE / 50.

◆ $instanceid

int tool_brickfield\scheduler::$instanceid

$instanceid The specific instance id of the context e.g.

courseid.


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