Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Class that represents an expired context.

Copyright: 2018 David Monllao
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 378 lines (11 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: expired_context  - X-Ref

Class that represents an expired context.

define_properties()   X-Ref
Return the definition of the properties of this model.

return: array

get_records_by_contextlevel($contextlevel = null, $status = false, $sort = 'timecreated',$offset = 0, $limit = 0)   X-Ref
Returns expired_contexts instances that match the provided level and status.

param: int $contextlevel The context level filter criterion.
param: bool $status The expired context record's status.
param: string $sort The sort column. Must match the column name in {tool_dataprivacy_ctxexpired} table
param: int $offset The query offset.
param: int $limit The query limit.
return: expired_context[]

get_record_count_by_contextlevel($contextlevel = null, $status = false)   X-Ref
Returns the number of expired_contexts instances that match the provided level and status.

param: int $contextlevel
param: bool $status
return: int

set_roleids_for(string $field, array $roleids)   X-Ref
Set the list of role IDs for either expiredroles, or unexpiredroles.

param: string  $field
param: int[]   $roleids
return: expired_context

get_roleids_for(string $field)   X-Ref
Get the list of role IDs for either expiredroles, or unexpiredroles.

param: string  $field
return: int[]

set_unexpiredroles(array $roleids)   X-Ref
Set the list of unexpired role IDs.

param: int[]   $roleids
return: expired_context

add_expiredroles(array $roleids)   X-Ref
Add a set of role IDs to the list of expired role IDs.

param: int[]   $roleids
return: expired_context

add_unexpiredroles(array $roleids)   X-Ref
Add a set of role IDs to the list of unexpired role IDs.

param: int[]   $roleids
return: unexpired_context

set_expiredroles(array $roleids)   X-Ref
Set the list of expired role IDs.

param: int[]   $roleids
return: expired_context

get_expiredroles()   X-Ref
Get the list of expired role IDs.

return: int[]

get_unexpiredroles()   X-Ref
Get the list of unexpired role IDs.

return: int[]

create_from_expiry_info(\context $context, expiry_info $info, bool $save = true)   X-Ref
Create a new expired_context based on the context, and expiry_info object.

param: \context        $context
param: expiry_info     $info
param: boolean         $save
return: expired_context

update_from_expiry_info(expiry_info $info)   X-Ref
Update the expired_context from an expiry_info object which relates to this context.

param: expiry_info     $info
return: $this

can_process_deletion()   X-Ref
Check whether this expired_context record is in a state ready for deletion to actually take place.

return: bool

is_complete()   X-Ref
Check whether this expired_context record has already been cleaned.

return: bool

is_fully_expired()   X-Ref
Whether this context has 'fully' expired.
That is to say that the default retention period has been reached, and that there are no unexpired roles.

return: bool