Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Differences Between: [Versions 39 and 400]

Condition main class.

Copyright: 2014 The Open University
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 310 lines (12 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: condition  - X-Ref

Condition main class.

__construct($structure)   X-Ref
Constructor.

param: \stdClass $structure Data structure from JSON decode

save()   X-Ref
No description

is_available($not, \core_availability\info $info, $grabthelot, $userid)   X-Ref
No description

get_grouping_id(\core_availability\info $info)   X-Ref
Gets the actual grouping id for the condition. This is either a specified
id, or a special flag indicating that we use the one for the current cm.

return: int Grouping id
param: \core_availability\info $info Info about context cm

get_description($full, $not, \core_availability\info $info)   X-Ref
No description

get_debug_string()   X-Ref
No description

include_after_restore($restoreid, $courseid, \base_logger $logger,$name, \base_task $task)   X-Ref
Include this condition only if we are including groups in restore, or
if it's a generic 'same activity' one.

return: Integer groupid
param: int $restoreid The restore Id.
param: int $courseid The ID of the course.
param: base_logger $logger The logger being used.
param: string $name Name of item being restored.
param: base_task $task The task being performed.

update_after_restore($restoreid, $courseid, \base_logger $logger, $name)   X-Ref
No description

update_dependency_id($table, $oldid, $newid)   X-Ref
No description

wipe_static_cache()   X-Ref
Wipes the static cache used to store grouping names.


is_applied_to_user_lists()   X-Ref
No description

filter_user_list(array $users, $not, \core_availability\info $info,\core_availability\capability_checker $checker)   X-Ref
No description

get_json($groupingid = 0)   X-Ref
Returns a JSON object which corresponds to a condition of this type.

Intended for unit testing, as normally the JSON values are constructed
by JavaScript code.

return: stdClass Object representing condition
param: int $groupingid Required grouping id (0 = grouping linked to activity)

get_user_list_sql($not, \core_availability\info $info, $onlyactive)   X-Ref
No description