Skip to content

Commit

Permalink
MDL-40935 events: get_legacy_eventname() should be public and static
Browse files Browse the repository at this point in the history
  • Loading branch information
ankitagarwal committed Aug 6, 2013
1 parent d2132f0 commit 2244600
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/classes/event/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ public function get_logextra() {
*
* @return null|string legacy event name
*/
protected function get_legacy_eventname() {
public static function get_legacy_eventname() {
return null;
}

Expand Down Expand Up @@ -477,7 +477,7 @@ public final function trigger() {

$this->dispatched = true;

if ($legacyeventname = $this->get_legacy_eventname()) {
if ($legacyeventname = static::get_legacy_eventname()) {
events_trigger_legacy($legacyeventname, $this->get_legacy_eventdata());
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/classes/event/role_assigned.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function get_url() {
*
* @return null|string legacy event name
*/
protected function get_legacy_eventname() {
public static function get_legacy_eventname() {
return 'role_assigned';
}

Expand Down
2 changes: 1 addition & 1 deletion lib/classes/event/role_unassigned.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function get_url() {
*
* @return null|string legacy event name
*/
protected function get_legacy_eventname() {
public static function get_legacy_eventname() {
return 'role_unassigned';
}

Expand Down
2 changes: 1 addition & 1 deletion lib/tests/fixtures/event_fixtures.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function get_url() {
return new moodle_url('/somepath/somefile.php', array('id'=>$this->data['other']['sample']));
}

protected function get_legacy_eventname() {
public static function get_legacy_eventname() {
return 'test_legacy';
}

Expand Down

0 comments on commit 2244600

Please sign in to comment.