Return legacy log data.

@return array
175940
protected function get_legacy_logdata() {
        $message = $this->get_record_snapshot('chat_messages', $this->objectid);
        return array($this->courseid, 'chat', 'talk', 'view.php?id=' . $this->contextinstanceid,
            $message->chatid, $this->contextinstanceid, $this->relateduserid);
    }
749666
protected function get_legacy_logdata() {
        // The legacy log table expects a relative path to /mod/forum/.
        $logurl = substr($this->get_url()->out_as_local_url(), strlen('/mod/forum/'));

        return array($this->courseid, 'forum', 'search', $logurl, $this->other['searchterm']);
    }
950650
public function getOriginalData()
    {
        $data = $this->data;
        $originals = array();
        foreach ($this->getOriginalFields() as $field) {
            $key = 'original_' . $field;
            if (array_key_exists($key, $data)) {
                $originals[$field] = $data[$key];
            }
        }
        return $originals;
    }
851060
protected function get_legacy_logdata() {
        $log1 = array($this->courseid, "course", "update mod", "../mod/" . $this->other['modulename'] . "/view.php?id=" .
                $this->objectid, $this->other['modulename'] . " " . $this->other['instanceid']);
        $log2 = array($this->courseid, $this->other['modulename'], "update",
               "view.php?id={$this->objectid}",
               "{$this->other['instanceid']}", $this->objectid);
        return array($log1, $log2);
    }
655987
public function actionDashboardLog()
    {
        $data = Log::find()->orderBy(['timestamp' => SORT_DESC])->with(['user'])->limit(60)->all();
        $log= [];
        foreach ($data as $item) {
            $log[strtotime('today', $item->timestamp)][] = $item;
        }
        
        $array = [];
        
        krsort($log, SORT_NUMERIC);
        
        foreach ($log as $day => $values) {
            $array[] = [
                'day' => $day,
                'items' => $values,
            ];
        }
        
        return $array;
    }
92459
public function getUpgradeStatusDetails() {
    $storage = $this->getLoggerEntityStorage();
    $total_count = (int) $storage->getQuery()
      ->count()
      ->execute();

    if ($total_count === 0) {
      return [
        'resolved' => 0,
        'conflicts' => 0,
        'total' => 0,
      ];
    }

    $conflicts = (int) $storage->getQuery()
      ->condition('status', 0)
      ->count()
      ->execute();
    return [
      'resolved' => $total_count - $conflicts,
      'conflicts' => $conflicts,
      'total' => $total_count,
    ];
  }
372585
public function get_legacy_logdata() {
        $hook = $mode = '';
        if (isset($this->other['hook'])) {
            $hook = $this->other['hook'];
        }
        if (isset($this->other['mode'])) {
            $mode = $this->other['mode'];
        }
        return array($this->courseid, 'glossary', 'delete entry',
            "view.php?id={$this->contextinstanceid}&amp;mode={$mode}&amp;hook={$hook}",
            $this->objectid, $this->contextinstanceid);
    }
799019
public function getLogFiles()
    {
        $files = new Finder();
        $files->files()->in(LOG_DIR)->name('*.log')->sortByModifiedTime();
        $logs = array();
        /** @var \SplFileInfo $file */
        foreach ($files as $file) {
            $size = $file->getSize() / 8 / 1024;
            $time = date('c', $file->getMTime());
            $dateTime = new \DateTime($time);
            if (!isset($logs[$dateTime->format('Y')])) {
                $logs[$dateTime->format('Y')] = [];
            }
            $logs[$dateTime->format('Y')][$dateTime->format('m')][$time] = [
                'filename' => $file->getFilename(),
                'size' => round($size, 3),
            ];
            krsort($logs[$dateTime->format('Y')][$dateTime->format('m')]);
            krsort($logs[$dateTime->format('Y')]);
        }
        return $logs;
    }
456213
public function getData()
    {
        $result = [
            'type' => $this->type
        ];

        switch($this->type)
        {

            case self::TYPE_WEB:
              $result['url'] = $this->url;

              if ($this->webview_height_ratio) {
                  $result['webview_height_ratio'] = $this->webview_height_ratio;
              }

              if ($this->messenger_extensions){
                  $result['messenger_extensions'] = $this->messenger_extensions;
                  $result['fallback_url'] = $this->fallback_url;
              }
            break;

        }

        return $result;
    }
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);
    }
830534
public function getVersionLogComments()
    {
        $app = Application::getFacadeApplication();
        $db = $app->make(Connection::class);
        $updates = [];
        $ga = $db->fetchAll(
            'SELECT fvUpdateTypeID, fvUpdateTypeAttributeID FROM FileVersionLog WHERE fID = ? AND fvID = ? ORDER BY fvlID ASC',
            [$this->getFileID(), $this->getFileVersionID()]
        );
        foreach ($ga as $a) {
            switch ($a['fvUpdateTypeID']) {
                case self::UT_REPLACE_FILE:
                    $updates[] = t('File');
                    break;
                case self::UT_TITLE:
                    $updates[] = t('Title');
                    break;
                case self::UT_DESCRIPTION:
                    $updates[] = t('Description');
                    break;
                case self::UT_TAGS:
                    $updates[] = t('Tags');
                    break;
                case self::UT_CONTENTS:
                    $updates[] = t('File Content');
                    break;
                case self::UT_RENAME:
                    $updates[] = t('File Name');
                    break;
                case self::UT_EXTENDED_ATTRIBUTE:
                    $val = $db->fetchColumn(
                        'SELECT akName FROM AttributeKeys WHERE akID = ?',
                        [$a['fvUpdateTypeAttributeID']]
                    );
                    if ($val !== false) {
                        $updates[] = $val;
                    }
                    break;
            }
        }

        return array_values(array_unique($updates));
    }
660403
public function getVersions()
    {
        $this->initLogTable();

        $query = $this->db->getQuery(true)
            ->select('version')
            ->from($this->db->quoteName($this->logTable))
            ->order('version ASC');

        return $this->db->setQuery($query)->loadColumn();
    }
335886
protected function get_legacy_logdata() {
        // The add_to_log function was only ever called when we sent a message from one user to another. We do not want
        // to return the legacy log data if we are sending a system message, so check that the userid is valid.
        if (\core_user::is_real_user($this->userid)) {
            $messageid = $this->other['messageid'] ?? $this->objectid; // For BC we may have 'messageid' in other.
            return array(SITEID, 'message', 'write', 'index.php?user=' . $this->userid . '&id=' . $this->relateduserid .
                '&history=1#m' . $messageid, $this->userid);
        }

        return null;
    }
832294
protected function get_legacy_eventdata() {
        return (object) array(
            'courseid' => $this->objectid,
            'userid' => $this->userid,
            'type' => $this->other['type'],
            'target' => $this->other['target'],
            'mode' => $this->other['mode'],
            'operation' => $this->other['operation'],
            'samesite' => $this->other['samesite'],
        );
    }
1044519
public function getData()
    {
        $return = [];

        foreach ($this->collections as $collection) {
            $return[$collection->name()] = $collection->items();
        }

        if (count($this->dump) != 0) {
            $return['dump'] = $this->dump;
        }

        return $return;
    }
579282
protected function get_legacy_logdata() {
        // The legacy log table expects a relative path to /mod/forum/.
        $logurl = substr($this->get_url()->out_as_local_url(), strlen('/mod/forum/'));

        return array($this->courseid, 'forum', 'delete post', $logurl, $this->objectid, $this->contextinstanceid);
    }
30709
protected function getCurrentInstance()
    {
        $instance = $this->getRequest()->getSession()->get('instance');
        
        if($instance) {
            // Update of instance to have last logs created
            $instance = $this->getManager()->find($instance->getId());
        }
        return $instance;
    }