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

Static Public Member Functions

static check_course_updates (int $batch=0)
 Checks all queued course updates, and finds all relevant areas.
 
static check_scheduled_areas (int $batch=0)
 Finds all areas that are waiting to be checked, performs checks.
 
static check_scheduled_deletions (int $batch=0)
 Finds all areas that are waiting to be deleted, performs deletions.
 
static delete_area_tree (\stdClass $area)
 Finds all records for a given content area and performs deletions.
 
static delete_historical_data ()
 Finds all records which are no longer current and performs deletions.
 
static delete_summary_data (int $courseid)
 Finds all summary cache records for a given courseid and performs deletions.
 
static find_new_or_updated_areas (\core\event\base $event)
 Asks all area providers if they have any areas that might have changed as a result of an event and schedules them.
 
static find_new_or_updated_areas_per_course (int $courseid)
 Asks all area providers if they have any areas that might have changed per courseid and schedules them.
 
static get_all_areas ()
 Find all available areas.
 
static get_checks ()
 Return an array of system checks available, and store them statically.
 
static get_cm_summary_for_course (int $courseid)
 Get course module summary information for a course.
 
static get_contenthash (?string $content=null)
 Calculate contenthash of a given content string.
 
static get_helpurl ()
 Get the help page URL.
 
static get_section_summary_for_course (int $courseid)
 Get section summary information for a course.
 
static is_okay_to_cache ()
 Return true if analysis hasn't been disabled.
 
static registration_message ()
 Returns an appropriate message about the current registration state.
 
static registration_url ()
 Returns the URL used for registration.
 
static store_result_summary (int $courseid=null)
 Finds all results required to display accessibility report and stores them in the database.
 

Public Attributes

const BULKRECORDLIMIT = 1000
 Default bulk record limit.
 
const DB_AREAS = self::PLUGINNAME . '_areas'
 Areas table name.
 
const DB_CACHEACTS = self::PLUGINNAME . '_cache_acts'
 Cacheacts table name.
 
const DB_CACHECHECK = self::PLUGINNAME . '_cache_check'
 Cachecheck table name.
 
const DB_CHECKS = self::PLUGINNAME . '_checks'
 Checks table name.
 
const DB_CONTENT = self::PLUGINNAME . '_content'
 Content table name.
 
const DB_ERRORS = self::PLUGINNAME . '_errors'
 Errors table name.
 
const DB_PROCESS = self::PLUGINNAME . '_process'
 Process table name.
 
const DB_RESULTS = self::PLUGINNAME . '_results'
 Results table name.
 
const DB_SCHEDULE = self::PLUGINNAME . '_schedule'
 Schedule table name.
 
const DB_SUMMARY = self::PLUGINNAME . '_summary'
 Summary table name.
 
const PLUGINNAME = 'tool_brickfield'
 Name of this plugin.
 
const STATUS_CHECKED = 1
 Defines the analysis has completed status.
 
const STATUS_INPROGRESS = -1
 Defined the analysis in progress status.
 
const STATUS_WAITING = 0
 Defines the waiting for analysis status.
 
const SUMMARY_ERROR = 0
 Defines summary error value.
 
const SUMMARY_FAILED = 1
 Defines summary failed value.
 
const SUMMARY_PERCENT = 2
 Defines summary percent value.
 

Static Protected Member Functions

static content_needs_scheduling (int $areaid, string $contenthash)
 Does the current area content need to be scheduled for check?
 
static get_area_content (\stdClass $arearecord)
 Returns the current content of the area.
 
static schedule_area_if_necessary (\stdClass $arearecord)
 Schedule an area for analysis if there has been changes.
 

Static Protected Attributes

static array $checks
 Statically stores the database checks records.
 

Member Function Documentation

◆ check_course_updates()

static tool_brickfield\manager::check_course_updates ( int $batch = 0)
static

Checks all queued course updates, and finds all relevant areas.

Parameters
int$batchlimit To be called from scheduled task
Exceptions
ReflectionException
dml_exception

◆ check_scheduled_areas()

static tool_brickfield\manager::check_scheduled_areas ( int $batch = 0)
static

Finds all areas that are waiting to be checked, performs checks.

Returns true if there were records processed, false if not. To be called from scheduled task

Parameters
int$batch
Return values
bool
Exceptions
coding_exception
ddl_exception
ddl_table_missing_exception
dml_exception

◆ check_scheduled_deletions()

static tool_brickfield\manager::check_scheduled_deletions ( int $batch = 0)
static

Finds all areas that are waiting to be deleted, performs deletions.

Parameters
int$batchlimit, can be called from runcli.php To be called from scheduled task
Exceptions
coding_exception
dml_exception

◆ content_needs_scheduling()

static tool_brickfield\manager::content_needs_scheduling ( int $areaid,
string $contenthash )
staticprotected

Does the current area content need to be scheduled for check?

It does not need to be scheduled if:

  • it is the current content OR
  • there is already schedule
Parameters
int$areaid
string$contenthash
Return values
bool
Exceptions
dml_exception

◆ delete_area_tree()

static tool_brickfield\manager::delete_area_tree ( \stdClass $area)
static

Finds all records for a given content area and performs deletions.

To be called from scheduled task

Parameters
stdClass$area
Exceptions
dml_exception

◆ delete_historical_data()

static tool_brickfield\manager::delete_historical_data ( )
static

Finds all records which are no longer current and performs deletions.

To be called from scheduled task.

◆ delete_summary_data()

static tool_brickfield\manager::delete_summary_data ( int $courseid)
static

Finds all summary cache records for a given courseid and performs deletions.

To be called from scheduled task.

Parameters
int$courseid
Exceptions
dml_exception

◆ find_new_or_updated_areas()

static tool_brickfield\manager::find_new_or_updated_areas ( \core\event\base $event)
static

Asks all area providers if they have any areas that might have changed as a result of an event and schedules them.

Parameters
core\event\base$event
Exceptions
ReflectionException
dml_exception

◆ find_new_or_updated_areas_per_course()

static tool_brickfield\manager::find_new_or_updated_areas_per_course ( int $courseid)
static

Asks all area providers if they have any areas that might have changed per courseid and schedules them.

Parameters
int$courseid
Exceptions
ReflectionException
coding_exception
ddl_exception
ddl_table_missing_exception
dml_exception

◆ get_all_areas()

static tool_brickfield\manager::get_all_areas ( )
static

Find all available areas.

Return values
area_base[]
Exceptions
ReflectionException

◆ get_area_content()

static tool_brickfield\manager::get_area_content ( \stdClass $arearecord)
staticprotected

Returns the current content of the area.

Parameters
stdClass$arearecordrecord from the tool_brickfield_areas table
Return values
array|nullarray where the first element is the value of the field and the second element is the 'format' for this field if it is present. If the record was not found null is returned.
Exceptions
ddl_exception
ddl_table_missing_exception
dml_exception

◆ get_checks()

static tool_brickfield\manager::get_checks ( )
static

Return an array of system checks available, and store them statically.

Return values
array
Exceptions
dml_exception

◆ get_cm_summary_for_course()

static tool_brickfield\manager::get_cm_summary_for_course ( int $courseid)
static

Get course module summary information for a course.

Parameters
int$courseid
Return values
stdClass[]

◆ get_contenthash()

static tool_brickfield\manager::get_contenthash ( ?string $content = null)
static

Calculate contenthash of a given content string.

Parameters
string | null$content
Return values
string

◆ get_helpurl()

static tool_brickfield\manager::get_helpurl ( )
static

Get the help page URL.

Return values
string
Exceptions
dml_exception

◆ get_section_summary_for_course()

static tool_brickfield\manager::get_section_summary_for_course ( int $courseid)
static

Get section summary information for a course.

Parameters
int$courseid
Return values
stdClass[]

◆ is_okay_to_cache()

static tool_brickfield\manager::is_okay_to_cache ( )
static

Return true if analysis hasn't been disabled.

Return values
bool
Exceptions
dml_exception

◆ registration_message()

static tool_brickfield\manager::registration_message ( )
static

Returns an appropriate message about the current registration state.

Return values
string
Exceptions
coding_exception
dml_exception
moodle_exception

◆ registration_url()

static tool_brickfield\manager::registration_url ( )
static

Returns the URL used for registration.

Return values
moodle_url

◆ schedule_area_if_necessary()

static tool_brickfield\manager::schedule_area_if_necessary ( \stdClass $arearecord)
staticprotected

Schedule an area for analysis if there has been changes.

Parameters
stdClass$arearecordrecord with the fields from the {tool_brickfield_areas} table as returned by area_base\find_relevant_areas(). It also contains the 'content' property with the current area content
Exceptions
dml_exception

◆ store_result_summary()

static tool_brickfield\manager::store_result_summary ( int $courseid = null)
static

Finds all results required to display accessibility report and stores them in the database.

To be called from scheduled task.

Parameters
int | null$courseid
Exceptions
coding_exception
dml_exception

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