Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
tool_dataprivacy\expiry_info Class Reference

Expiry Data. More...

Public Member Functions

 __construct (bool $default, bool $defaultprotected, array $expired, array $unexpired, array $protectedroles)
 Constructor for the expiry_info class.
 
 get_expired_roles ()
 Get the list of explicitly expired role IDs.
 
 get_unexpired_protected_roles ()
 Get the list of unexpired protected roles.
 
 get_unexpired_roles ()
 Get the list of unexpired role IDs.
 
 get_unprotected_overridden_roles ()
 Get a list of all overridden roles which are unprotected.
 
 is_any_expired ()
 Whether any part of this context has expired.
 
 is_default_expired ()
 Whether the default retention policy has been reached.
 
 is_default_protected ()
 Whether the default purpose is protected.
 
 is_fully_expired ()
 Whether this context has 'fully' expired.
 
 is_role_expired (int $roleid)
 Check whether the specified role is explicitly expired.
 
 merge_with_child (expiry_info $child)
 Merge this expiry_info object with another belonging to a child context in order to set the 'safest' heritage.
 

Protected Attributes

bool $defaultexpiryreached = false
 Whether the default expiry value of this purpose has been reached.
 
bool $defaultprotected = false
 Whether the default purpose is protected.
 
int[] $expired = []
 List of expires roles.
 
bool $fullyexpired = false
 Whether this context is fully expired.
 
int[] $protectedroles = []
 List of unexpired roles which are also protected.
 
int[] $unexpired = []
 List of unexpires roles.
 

Detailed Description

Expiry Data.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Constructor & Destructor Documentation

◆ __construct()

tool_dataprivacy\expiry_info::__construct ( bool $default,
bool $defaultprotected,
array $expired,
array $unexpired,
array $protectedroles )

Constructor for the expiry_info class.

Parameters
bool$defaultWhether the default expiry period for this context has been reached.
bool$defaultprotectedWhether the default expiry is protected.
int[]$expiredA list of roles in this context which have explicitly expired.
int[]$unexpiredA list of roles in this context which have not yet expired.
int[]$protectedrolesA list of unexpired roles in this context which are protected.

Member Function Documentation

◆ get_expired_roles()

tool_dataprivacy\expiry_info::get_expired_roles ( )

Get the list of explicitly expired role IDs.

Note: This does not list roles which have been expired via the default retention policy being reached.

Return values
int[]

◆ get_unexpired_protected_roles()

tool_dataprivacy\expiry_info::get_unexpired_protected_roles ( )

Get the list of unexpired protected roles.

Return values
int[]

◆ get_unexpired_roles()

tool_dataprivacy\expiry_info::get_unexpired_roles ( )

Get the list of unexpired role IDs.

Return values
int[]

◆ get_unprotected_overridden_roles()

tool_dataprivacy\expiry_info::get_unprotected_overridden_roles ( )

Get a list of all overridden roles which are unprotected.

Return values
int[]

◆ is_any_expired()

tool_dataprivacy\expiry_info::is_any_expired ( )

Whether any part of this context has expired.

Return values
bool

◆ is_default_expired()

tool_dataprivacy\expiry_info::is_default_expired ( )

Whether the default retention policy has been reached.

Return values
bool

◆ is_default_protected()

tool_dataprivacy\expiry_info::is_default_protected ( )

Whether the default purpose is protected.

Return values
bool

◆ is_fully_expired()

tool_dataprivacy\expiry_info::is_fully_expired ( )

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 values
bool

◆ is_role_expired()

tool_dataprivacy\expiry_info::is_role_expired ( int $roleid)

Check whether the specified role is explicitly expired.

Note: This does not list roles which have been expired via the default retention policy being reached.

Parameters
int$roleid
Return values
bool

◆ merge_with_child()

tool_dataprivacy\expiry_info::merge_with_child ( expiry_info $child)

Merge this expiry_info object with another belonging to a child context in order to set the 'safest' heritage.

It is not possible to delete any part of a context that is not deleted by a parent. So if a course's retention policy has been reached, then only parts where the children have also expired can be deleted.

Parameters
expiry_info$childThe child record to merge with.
Return values
$this

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