Legacy event data if get_legacy_eventname() is not empty.

@return \stdClass
501609
protected function get_legacy_eventdata() {
        $eventdata = new \stdClass();
        $eventdata->groupid = $this->objectid;
        $eventdata->userid  = $this->relateduserid;
        return $eventdata;
    }
419907
protected function get_legacy_logdata() {
        $lesson = $this->get_record_snapshot('lesson', $this->other['lessonid']);
        return array($this->courseid, 'lesson', 'update grade', 'essay.php?id=' .
                $this->contextinstanceid, $lesson->name, $this->contextinstanceid);
    }
538178
protected function get_legacy_logdata() {
        if ($this->contextlevel == CONTEXT_COURSE) {
            return array($this->courseid, 'user', 'view', 'view.php?id=' . $this->relateduserid . '&course=' .
                $this->courseid, $this->relateduserid);
        }
        return null;
    }
257270
protected function get_legacy_logdata() {
        $user = $this->get_record_snapshot('user', $this->relateduserid);
        $logmessage = get_string('unlocksubmissionforstudent', 'assign', array('id' => $user->id, 'fullname' => fullname($user)));
        $this->set_legacy_logdata('unlock submission', $logmessage);
        return parent::get_legacy_logdata();
    }
312151
public function get_legacy_logdata() {
        $user = $this->get_record_snapshot('user', $this->relateduserid);
        $fullname = fullname($user);
        $info = $this->grade->grade_item->itemname . ': ' . $fullname;
        $url = '/report/grader/index.php?id=' . $this->courseid;

        return array($this->courseid, 'grade', 'update', $url, $info);
    }
426969
public function getName()
    {
        if (!$this->isEmpty($this->name)) {
            return $this->name;
        }

        foreach (['getName', 'getOriginalName'] as $fn) {
            $name = call_user_func([$this->event, $fn]);

            if ($this->isEmpty($name) || $name === $this) {
                continue;
            }

            if ($name instanceof self) {
                return $name = $name->getName();
            }
        }

        return $this->name = $this->parseEventName();
    }
609822
public function currentEvent()
    {
        if ($this->currentEvent) {
            return $this->currentEvent;
        }

        // The the current event
        $event = $this->eventManager()->entry();

        // Format the event
        if ($event) {
            $this->currentEvent = $this->eventFormatFull($event);
        }

        return $this->currentEvent;
    }
1080520
public function getEventManager()
    {
        if (!$this->events instanceof EventManagerInterface) {
            $identifiers = array(__CLASS__, get_called_class());
            if (isset($this->eventIdentifier)) {
                if ((is_string($this->eventIdentifier))
                    || (is_array($this->eventIdentifier))
                    || ($this->eventIdentifier instanceof Traversable)
                ) {
                    $identifiers = array_unique($identifiers + (array) $this->eventIdentifier);
                } elseif (is_object($this->eventIdentifier)) {
                    $identifiers[] = $this->eventIdentifier;
                }
                // silently ignore invalid eventIdentifier types
            }
            $this->setEventManager(new EventManager($identifiers));
        }
        return $this->events;
    }
270721
protected function getEvent()
    {
        if (null === $this->event) {
            $this->event = $event = new EntityEvent;

            $event->setTarget($this);
        }

        return $this->event;
    }
1304201
public function getEventCounter()
    {
        // BC support for old formats
        foreach ($this->events as $type => $events) {
            if (!isset($this->totalEvents[$type])) {
                $this->totalEvents[$type] = count($events);
            }
        }

        $counter = [
            'total' => array_sum($this->totalEvents),
        ];

        if ($this->countOnly && $this->groupUnit) {
            $counter['byUnit'] = $this->totalEventsByUnit;
        }

        return $counter;
    }
1144713
protected function get_legacy_logdata() {
        $lesson = $this->get_record_snapshot('lesson', $this->objectid);

        return array($this->courseid, 'lesson', 'view highscores', 'highscores.php?id=' . $this->contextinstanceid,
            $lesson->name, $this->contextinstanceid);
    }
156140
protected function get_legacy_logdata() {
        if ($this->contextlevel == CONTEXT_MODULE) {
            return array($this->courseid, 'quiz', 'addcategory', 'view.php?id=' . $this->contextinstanceid,
                $this->objectid, $this->contextinstanceid);
        }
        // This is not related to individual quiz at all.
        return null;
    }
1226826
public static function get_calendar_event_by_id($eventid) {
        global $PAGE, $USER;

        $params = self::validate_parameters(self::get_calendar_event_by_id_parameters(), ['eventid' => $eventid]);
        $context = \context_user::instance($USER->id);

        self::validate_context($context);
        $warnings = array();

        $legacyevent = calendar_event::load($eventid);
        // Must check we can see this event.
        if (!calendar_view_event_allowed($legacyevent)) {
            // We can't return a warning in this case because the event is not optional.
            // We don't know the context for the event and it's not worth loading it.
            $syscontext = context_system::instance();
            throw new \required_capability_exception($syscontext, 'moodle/course:view', 'nopermission', '');
        }

        $legacyevent->count_repeats();

        $eventmapper = event_container::get_event_mapper();
        $event = $eventmapper->from_legacy_event_to_event($legacyevent);

        $cache = new events_related_objects_cache([$event]);
        $relatedobjects = [
            'context' => $cache->get_context($event),
            'course' => $cache->get_course($event),
        ];

        $exporter = new event_exporter($event, $relatedobjects);
        $renderer = $PAGE->get_renderer('core_calendar');

        return array('event' => $exporter->export($renderer), 'warnings' => $warnings);
    }
70555
protected function get_legacy_eventdata() {
        $eventdata = new \stdClass();
        $eventdata->modulename   = 'forum';
        $eventdata->name         = $this->other['triggeredfrom'];
        $eventdata->cmid         = $this->contextinstanceid;
        $eventdata->itemid       = $this->objectid;
        $eventdata->courseid     = $this->courseid;
        $eventdata->userid       = $this->userid;
        $eventdata->content      = $this->other['content'];
        if ($this->other['pathnamehashes']) {
            $eventdata->pathnamehashes = $this->other['pathnamehashes'];
        }
        return $eventdata;
    }
37712
protected function get_legacy_logdata() {
        if (empty($this->resourceslist)) {
            return null;
        }
        $logs = array();
        foreach ($this->resourceslist as $resourcename) {
            $logs[] = array($this->courseid, $resourcename, 'view all', 'index.php?id=' . $this->courseid, '');
        }
        return $logs;
    }
586098
public function getEventSourceId()
    {
        if ($this->isUserEvent()) {
            return $this->getUserId();
        }

        if ($this->isGroupEvent()) {
            return $this->getGroupId();
        }

        if ($this->isRoomEvent()) {
            return $this->getRoomId();
        }

        # Unknown event
        return null;
    }
1227799
protected function get_legacy_logdata() {
        if ($this->courseid == SITEID and !isloggedin()) {
            // We did not log frontpage access in older Moodle versions.
            return null;
        }

        // We keep compatibility with 2.7 and 2.8 other['coursesectionid'].
        if (isset($this->other['coursesectionnumber']) || isset($this->other['coursesectionid'])) {
            if (isset($this->other['coursesectionnumber'])) {
                $sectionnumber = $this->other['coursesectionnumber'];
            } else {
                $sectionnumber = $this->other['coursesectionid'];
            }
            return array($this->courseid, 'course', 'view section', 'view.php?id=' . $this->courseid . '&amp;section='
                    . $sectionnumber, $sectionnumber);
        }
        return array($this->courseid, 'course', 'view', 'view.php?id=' . $this->courseid, $this->courseid);
    }