Merge branch 'wip-mdl-31969' of git://github.com/rajeshtaneja/moodle
[moodle.git] / lib / db / events.php
CommitLineData
117bd748 1<?php
5b4a78e2
PS
2// This file is part of Moodle - http://moodle.org/
3//
4// Moodle is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// Moodle is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
ca4bcf58 16
5b4a78e2 17/**
ef6cf871 18 * Definition of core event handler and description of all events throws from core.
5b4a78e2 19 *
39b90b51
EL
20 * The handlers defined on this file are processed and registered into
21 * the Moodle DB after any install or upgrade operation. All plugins
22 * support this.
23 *
24 * For more information, take a look to the documentation available:
25 * - Events API: {@link http://docs.moodle.org/dev/Events_API}
26 * - Upgrade API: {@link http://docs.moodle.org/dev/Upgrade_API}
27 *
28 * @package core
29 * @category event
1d1719f5 30 * @copyright 2007 onwards Martin Dougiamas http://dougiamas.com
39b90b51 31 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
5b4a78e2 32 */
ca4bcf58 33
5b4a78e2 34defined('MOODLE_INTERNAL') || die();
2942a5cd 35
36/* List of handlers */
37
df997f84 38$handlers = array(
3b120e46 39
fc053de9 40/*
41 * portfolio queued event - for non interactive file transfers
df997f84
PS
42 * NOTE: this is a HACK, please do not add any more things like this here
43 * (it is just abusing cron to do very time consuming things which is wrong any way)
44 *
45 * TODO: this has to be moved into separate queueing framework....
46 */
fc053de9 47 'portfolio_send' => array (
48 'handlerfile' => '/lib/portfolio.php',
49 'handlerfunction' => 'portfolio_handle_event', // argument to call_user_func(), could be an array
650462df
PS
50 'schedule' => 'cron',
51 'internal' => 0,
fc053de9 52 ),
27806552
YB
53 'course_completed' => array (
54 'handlerfile' => '/lib/badgeslib.php',
55 'handlerfunction' => 'badges_award_handle_course_criteria_review',
56 'schedule' => 'instant',
57 'internal' => 1,
58 ),
59 'activity_completion_changed' => array (
60 'handlerfile' => '/lib/badgeslib.php',
61 'handlerfunction' => 'badges_award_handle_activity_criteria_review',
62 'schedule' => 'instant',
63 'internal' => 1,
64 ),
65 'user_updated' => array (
66 'handlerfile' => '/lib/badgeslib.php',
67 'handlerfunction' => 'badges_award_handle_profile_criteria_review',
68 'schedule' => 'instant',
69 'internal' => 1,
70 ),
fc053de9 71
df997f84 72/* no more here please, core should not consume any events!!!!!!! */
3b120e46 73);
74
ca4bcf58 75
2942a5cd 76
77
78/* List of events thrown from Moodle core
79
80==== user related events ====
81
82user_created - object user table record
83user_updated - object user table record
84user_deleted - object user table record
a8e3b008 85user_logout - full $USER object
2942a5cd 86
87==== course related events ====
88
89course_category_updated - object course_categories table record
90course_category_created - object course_categories table record
91course_category_deleted - object course_categories table record
92
93course_created - object course table record
94course_updated - object course table record
582bae08
PS
95course_content_removed - object course table record + context property
96course_deleted - object course table record + context property
bf989c2f 97course_restored - custom object with courseid, userid and restore information
2942a5cd 98
df997f84 99user_enrolled - object record from user_enrolments table + courseid,enrol
358fb4dc 100user_enrol_modified - object record from user_enrolments table + courseid,enrol
df997f84
PS
101user_unenrolled - object record from user_enrolments table + courseid,enrol,lastenrol
102
103==== cohort related events ===
104
105
106cohort_added - object cohort table record
107cohort_updated - object cohort table record
108cohort_deleted - object cohort table record
109
110cohort_member_added - object cohortid, userid properties
111cohort_member_removed - object cohortid, userid properties
112
2942a5cd 113==== group related events ====
114
115groups_group_created - object groups_group table record
116groups_group_updated - object groups_group table record
117groups_group_deleted - object groups_group table record
118
119groups_member_added - object userid, groupid properties
120groups_member_removed - object userid, groupid properties
121
122groups_grouping_created - object groups_grouping table record
123groups_grouping_updated - object groups_grouping table record
124groups_grouping_deleted - object groups_grouping table record
125
ffc670d9 126groups_members_removed - object courseid+userid - removed all users (or one user) from all groups in course
2942a5cd 127groups_groupings_groups_removed - int course id - removed all groups from all groupings in course
128groups_groups_deleted - int course id - deleted all course groups
129groups_groupings_deleted - int course id - deleted all course groupings
130
906fb8f8 131==== role related events ====
96608a55 132
133role_assigned - object role_assignments table record
134role_unassigned - object role_assignments table record
135
9645a484 136==== activity module events ====
75ba5fe4 137
9645a484
MD
138mod_deleted - int courseid, int cmid, text modulename - happens when a module is deleted
139mod_created - int courseid, int cmid, text modulename - happens when a module is created
140mod_updated - int courseid, int cmid, text modulename - happens when a module is updated
75ba5fe4 141
af7e05d6
EL
142=== blog events
143
144blog_entry_added - blog post object
145blog_entry_edited - blog post object
146blog_entry_deleteded - blog post object
147
2942a5cd 148*/