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 310 and 402] [Versions 310 and 403]

External database store.

Copyright: 2013 Petr Skoda {@link http://skodak.org}
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 311 lines (10 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
Construct

param: \tool_log\log\manager $manager

init()   X-Ref
Setup the Database.

return: bool

is_event_ignored(\core\event\base $event)   X-Ref
Should the event be ignored (== not logged)?

param: \core\event\base $event
return: bool

insert_event_entries($evententries)   X-Ref
Insert events in bulk to the database.

param: array $evententries raw event data

get_events_select($selectwhere, array $params, $sort, $limitfrom, $limitnum)   X-Ref
Get an array of events based on the passed on params.

param: string $selectwhere select conditions.
param: array $params params.
param: string $sort sortorder.
param: int $limitfrom limit constraints.
param: int $limitnum limit constraints.
return: array|\core\event\base[] array of events.

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

Note that the traversable object contains a moodle_recordset, so
remember that is important that you call close() once you finish
using it.

param: string $selectwhere
param: array $params
param: string $sort
param: int $limitfrom
param: int $limitnum
return: \core\dml\recordset_walk|\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
Get number of events present for the given select clause.

param: string $selectwhere select conditions.
param: array $params params.
return: int Number of events available for the given conditions

get_config_value($name, $default = null)   X-Ref
Get a config value for the store.

param: string $name Config name
param: mixed $default default value
return: mixed config value if set, else the default value.

get_extdb()   X-Ref
Get the external database object.

return: \moodle_database $extdb

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
Dispose off database connection after pushing any buffered events to the database.