Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

Privacy Fetch Result Set.

Copyright: 2018 Andrew Nicols <andrew@nicols.co.uk>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 190 lines (7 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

contextlist:: (6 methods):
  add_from_sql()
  add_system_context()
  add_user_context()
  add_user_contexts()
  set_component()
  guess_id_field_from_sql()


Class: contextlist  - X-Ref

Privacy Fetch Result Set.

add_from_sql(string $sql, array $params)   X-Ref
Add a set of contexts from  SQL.

The SQL should only return a list of context IDs.

param: string  $sql    The SQL which will fetch the list of * context IDs
param: array   $params The set of SQL parameters
return: $this

add_system_context()   X-Ref
Adds the system context.

return: $this

add_user_context(int $userid)   X-Ref
Adds the user context for a given user.

param: int $userid
return: $this

add_user_contexts(array $userids)   X-Ref
Adds the user contexts for given users.

param: array $userids
return: $this

set_component($component)   X-Ref
Sets the component for this contextlist.

param: string $component the frankenstyle component name.

guess_id_field_from_sql(string $sql)   X-Ref
Guess the name of the contextid field from the supplied SQL.

param: string  $sql The SQL to guess from
return: string  The field name or a numeric value representing the context id