Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 310 and 401] [Versions 311 and 401] [Versions 39 and 401] [Versions 401 and 402] [Versions 401 and 403]

External groups API

Copyright: 2009 Petr Skodak
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 1586 lines (61 kb)
Included or required:0 times
Referenced: 18 times
Includes or requires: 0 files

Defines 1 class

core_group_external:: (55 methods):
  create_groups_parameters()
  create_groups()
  create_groups_returns()
  get_groups_parameters()
  get_groups()
  get_groups_returns()
  get_course_groups_parameters()
  get_course_groups()
  get_course_groups_returns()
  delete_groups_parameters()
  delete_groups()
  delete_groups_returns()
  get_group_members_parameters()
  get_group_members()
  get_group_members_returns()
  add_group_members_parameters()
  add_group_members()
  add_group_members_returns()
  delete_group_members_parameters()
  delete_group_members()
  delete_group_members_returns()
  create_groupings_parameters()
  create_groupings()
  create_groupings_returns()
  update_groupings_parameters()
  update_groupings()
  update_groupings_returns()
  get_groupings_parameters()
  get_groupings()
  get_groupings_returns()
  get_course_groupings_parameters()
  get_course_groupings()
  get_course_groupings_returns()
  delete_groupings_parameters()
  delete_groupings()
  delete_groupings_returns()
  assign_grouping_parameters()
  assign_grouping()
  assign_grouping_returns()
  unassign_grouping_parameters()
  unassign_grouping()
  unassign_grouping_returns()
  get_course_user_groups_parameters()
  get_course_user_groups()
  get_course_user_groups_returns()
  group_description()
  get_activity_allowed_groups_parameters()
  get_activity_allowed_groups()
  get_activity_allowed_groups_returns()
  get_activity_groupmode_parameters()
  get_activity_groupmode()
  get_activity_groupmode_returns()
  update_groups_parameters()
  update_groups()
  update_groups_returns()


Class: core_group_external  - X-Ref

Group external functions

create_groups_parameters()   X-Ref
Returns description of method parameters

return: external_function_parameters

create_groups($groups)   X-Ref
Create groups

param: array $groups array of group description arrays (with keys groupname and courseid)
return: array of newly created groups

create_groups_returns()   X-Ref
Returns description of method result value

return: external_description

get_groups_parameters()   X-Ref
Returns description of method parameters

return: external_function_parameters

get_groups($groupids)   X-Ref
Get groups definition specified by ids

param: array $groupids arrays of group ids
return: array of group objects (id, courseid, name, enrolmentkey)

get_groups_returns()   X-Ref
Returns description of method result value

return: external_description

get_course_groups_parameters()   X-Ref
Returns description of method parameters

return: external_function_parameters

get_course_groups($courseid)   X-Ref
Get all groups in the specified course

param: int $courseid id of course
return: array of group objects (id, courseid, name, enrolmentkey)

get_course_groups_returns()   X-Ref
Returns description of method result value

return: external_description

delete_groups_parameters()   X-Ref
Returns description of method parameters

return: external_function_parameters

delete_groups($groupids)   X-Ref
Delete groups

param: array $groupids array of group ids

delete_groups_returns()   X-Ref
Returns description of method result value

return: null

get_group_members_parameters()   X-Ref
Returns description of method parameters

return: external_function_parameters

get_group_members($groupids)   X-Ref
Return all members for a group

param: array $groupids array of group ids
return: array with  group id keys containing arrays of user ids

get_group_members_returns()   X-Ref
Returns description of method result value

return: external_description

add_group_members_parameters()   X-Ref
Returns description of method parameters

return: external_function_parameters

add_group_members($members)   X-Ref
Add group members

param: array $members of arrays with keys userid, groupid

add_group_members_returns()   X-Ref
Returns description of method result value

return: null

delete_group_members_parameters()   X-Ref
Returns description of method parameters

return: external_function_parameters

delete_group_members($members)   X-Ref
Delete group members

param: array $members of arrays with keys userid, groupid

delete_group_members_returns()   X-Ref
Returns description of method result value

return: null

create_groupings_parameters()   X-Ref
Returns description of method parameters

return: external_function_parameters

create_groupings($groupings)   X-Ref
Create groupings

param: array $groupings array of grouping description arrays (with keys groupname and courseid)
return: array of newly created groupings

create_groupings_returns()   X-Ref
Returns description of method result value

return: external_description

update_groupings_parameters()   X-Ref
Returns description of method parameters

return: external_function_parameters

update_groupings($groupings)   X-Ref
Update groupings

param: array $groupings array of grouping description arrays (with keys groupname and courseid)
return: array of newly updated groupings

update_groupings_returns()   X-Ref
Returns description of method result value

return: external_description

get_groupings_parameters()   X-Ref
Returns description of method parameters

return: external_function_parameters

get_groupings($groupingids, $returngroups = false)   X-Ref
Get groupings definition specified by ids

param: array $groupingids arrays of grouping ids
param: boolean $returngroups return the associated groups if true. The default is false.
return: array of grouping objects (id, courseid, name)

get_groupings_returns()   X-Ref
Returns description of method result value

return: external_description

get_course_groupings_parameters()   X-Ref
Returns description of method parameters

return: external_function_parameters

get_course_groupings($courseid)   X-Ref
Get all groupings in the specified course

param: int $courseid id of course
return: array of grouping objects (id, courseid, name, enrolmentkey)

get_course_groupings_returns()   X-Ref
Returns description of method result value

return: external_description

delete_groupings_parameters()   X-Ref
Returns description of method parameters

return: external_function_parameters

delete_groupings($groupingids)   X-Ref
Delete groupings

param: array $groupingids array of grouping ids
return: void

delete_groupings_returns()   X-Ref
Returns description of method result value

return: external_description

assign_grouping_parameters()   X-Ref
Returns description of method parameters

return: external_function_parameters

assign_grouping($assignments)   X-Ref
Assign a group to a grouping

param: array $assignments of arrays with keys groupid, groupingid
return: void

assign_grouping_returns()   X-Ref
Returns description of method result value

return: null

unassign_grouping_parameters()   X-Ref
Returns description of method parameters

return: external_function_parameters

unassign_grouping($unassignments)   X-Ref
Unassign a group from a grouping

param: array $unassignments of arrays with keys groupid, groupingid
return: void

unassign_grouping_returns()   X-Ref
Returns description of method result value

return: null

get_course_user_groups_parameters()   X-Ref
Returns description of method parameters

return: external_function_parameters

get_course_user_groups($courseid = 0, $userid = 0, $groupingid = 0)   X-Ref
Get all groups in the specified course for the specified user.

param: int $courseid id of course.
param: int $userid id of user.
param: int $groupingid optional returns only groups in the specified grouping.
return: array of group objects (id, name, description, format) and possible warnings.

get_course_user_groups_returns()   X-Ref
Returns description of method result value.

return: external_description A single structure containing groups and possible warnings.

group_description()   X-Ref
Create group return value description.

return: external_single_structure The group description

get_activity_allowed_groups_parameters()   X-Ref
Returns description of method parameters

return: external_function_parameters

get_activity_allowed_groups($cmid, $userid = 0)   X-Ref
Gets a list of groups that the user is allowed to access within the specified activity.

param: int $cmid course module id
param: int $userid id of user.
return: array of group objects (id, name, description, format) and possible warnings.

get_activity_allowed_groups_returns()   X-Ref
Returns description of method result value.

return: external_description A single structure containing groups and possible warnings.

get_activity_groupmode_parameters()   X-Ref
Returns description of method parameters

return: external_function_parameters

get_activity_groupmode($cmid)   X-Ref
Returns effective groupmode used in a given activity.

param: int $cmid course module id.
return: array containing the group mode and possible warnings.

get_activity_groupmode_returns()   X-Ref
Returns description of method result value.

return: external_description

update_groups_parameters()   X-Ref
Returns description of method parameters

return: external_function_parameters

update_groups($groups)   X-Ref
Update groups

param: array $groups
return: null

update_groups_returns()   X-Ref
Returns description of method result value

return: null