Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 311 and 400] [Versions 311 and 401] [Versions 311 and 402] [Versions 311 and 403]

Event vault class

Copyright: 2017 Ryan Wyllie <ryan@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 396 lines (13 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: event_vault  - X-Ref

Event vault class.

This class will handle interacting with the database layer to retrieve
the records. This is required to house the complex logic required for
pagination because it's not a one-to-one mapping between database records
and users.

This is a repository. It's called a vault to reduce confusion because
Moodle has already taken the name repository. Vault is cooler anyway.

__construct(event_factory_interface $factory,raw_event_retrieval_strategy_interface $retrievalstrategy)   X-Ref
Create an event vault.

param: event_factory_interface $factory An event factory
param: raw_event_retrieval_strategy_interface $retrievalstrategy

get_event_by_id($id)   X-Ref
No description

get_events($timestartfrom = null,$timestartto = null,$timesortfrom = null,$timesortto = null,event_interface $timestartafterevent = null,event_interface $timesortafterevent = null,$limitnum = 20,$type = null,array $usersfilter = null,array $groupsfilter = null,array $coursesfilter = null,array $categoriesfilter = null,$withduration = true,$ignorehidden = true,callable $filter = null)   X-Ref
No description

get_action_events_by_timesort(\stdClass $user,$timesortfrom = null,$timesortto = null,event_interface $afterevent = null,$limitnum = 20,$limittononsuspendedevents = false)   X-Ref
No description

get_action_events_by_course(\stdClass $user,\stdClass $course,$timesortfrom = null,$timesortto = null,event_interface $afterevent = null,$limitnum = 20)   X-Ref
No description

timefield_pagination_from($field,$timefrom,$lastseentime = null,$lastseenid = null,$withduration = true)   X-Ref
No description

timefield_pagination_to($field,$timeto,$lastseentime = null,$lastseenid = null)   X-Ref
Generates SQL subquery and parameters for 'to' pagination.

param: string   $field
param: int      $timeto
param: int|null $lastseentime
param: int|null $lastseenid
return: array|bool

transform_from_database_record(\stdClass $record)   X-Ref
Create an event from a database record.

param: \stdClass $record The database record
return: event_interface|null

get_from_db($userid,$whereconditions,$whereparams,$ordersql,$offset,$limitnum)   X-Ref
Fetches records from DB.

param: int    $userid
param: string $whereconditions
param: array  $whereparams
param: string $ordersql
param: int    $offset
param: int    $limitnum
return: array