[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/admin/tool/cohortroles/classes/ -> api.php (summary)

Class exposing the api for the cohortroles tool.

Copyright: 2015 Damyon Wiese
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 228 lines (9 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

api:: (5 methods):
  create_cohort_role_assignment()
  delete_cohort_role_assignment()
  list_cohort_role_assignments()
  count_cohort_role_assignments()
  sync_all_cohort_roles()


Class: api  - X-Ref

Class for doing things with cohort roles.

create_cohort_role_assignment(stdClass $record)   X-Ref
Create a cohort role assignment from a record containing all the data for the class.

Requires moodle/role:manage capability at the system context.

param: stdClass $record Record containing all the data for an instance of the class.
return: competency

delete_cohort_role_assignment($id)   X-Ref
Delete a cohort role assignment by id.

Requires moodle/role:manage capability at the system context.

param: int $id The record to delete. This will also remove this role from the user for all users in the system.
return: boolean

list_cohort_role_assignments($sort = '', $order = 'ASC', $skip = 0, $limit = 0)   X-Ref
Perform a search based on the provided filters and return a paginated list of records.

Requires moodle/role:manage capability at the system context.

param: string $sort The column to sort on
param: string $order ('ASC' or 'DESC')
param: int $skip Number of records to skip (pagination)
param: int $limit Max of records to return (pagination)
return: array of cohort_role_assignment

count_cohort_role_assignments()   X-Ref
Perform a search based on the provided filters and return a paginated list of records.

Requires moodle/role:manage capability at system context.

return: int

sync_all_cohort_roles()   X-Ref
Sync all roles - adding and deleting role assignments as required.

Slow. Should only be called from a background task.

Requires moodle/role:manage capability at the system context.

return: array('rolesadded' => array of (useridassignedto, useridassignedover, roleid),



Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1