Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 310 and 401] [Versions 39 and 310]

Legacy log reader.

Copyright: 2013 Petr Skoda {@link http://skodak.org}
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 401 lines (16 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: store  - X-Ref

__construct(\tool_log\log\manager $manager)   X-Ref

param: \tool_log\log\manager $manager

replace_sql_legacy($selectwhere, array $params, $sort = '')   X-Ref
This method contains mapping required for Moodle core to make legacy store compatible with other sql_reader based
queries.

param: string $selectwhere Select statment
param: array $params params for the sql
param: string $sort sort fields
return: array returns an array containing the sql predicate, an array of params and sorting parameter.

get_events_select($selectwhere, array $params, $sort, $limitfrom, $limitnum)   X-Ref

param: string $selectwhere
param: array  $params
param: string $sort
param: int    $limitfrom
param: int    $limitnum
return: array

get_events_select_iterator($selectwhere, array $params, $sort, $limitfrom, $limitnum)   X-Ref
Fetch records using given criteria returning a Traversable object.

param: string $selectwhere
param: array $params
param: string $sort
param: int $limitfrom
param: int $limitnum
return: \Traversable|\core\event\base[]

get_log_event($data)   X-Ref
Returns an event from the log data.

param: stdClass $data Log data
return: \core\event\base

get_events_select_count($selectwhere, array $params)   X-Ref

param: string $selectwhere
param: array  $params
return: int

is_logging()   X-Ref
Are the new events appearing in the reader?

return: bool true means new log events are being added, false means no new data will be added

dispose()   X-Ref


legacy_add_to_log($courseid, $module, $action, $url, $info, $cm, $user, $ip = null, $time = null)   X-Ref
Legacy add_to_log() code.

param: int $courseid The course id
param: string $module The module name  e.g. forum, journal, resource, course, user etc
param: string $action 'view', 'update', 'add' or 'delete', possibly followed by another word to clarify.
param: string $url The file and parameters used to see the results of the action
param: string $info Additional description information
param: int $cm The course_module->id if there is one
param: int|\stdClass $user If log regards $user other than $USER
param: string $ip Override the IP, should only be used for restore.
param: int $time Override the log time, should only be used for restore.

replace_crud($match)   X-Ref
Generate a replace string for crud related sql conditions. This function is called as callback to preg_replace_callback()
on the actual sql.

param: array $match matched string for the passed pattern
return: string The sql string to use instead of original