Returns the appropriate string for the event education level.

@param int $edulevel Takes either the edulevel constant or string.
@return string get_string for the specific education level.
427416
public static function get_edulevel_string($edulevel) {
        switch ($edulevel) {
            case \core\event\base::LEVEL_PARTICIPATING:
                return get_string('participating', 'report_eventlist');
                break;

            case \core\event\base::LEVEL_TEACHING:
                return get_string('teaching', 'report_eventlist');
                break;

            case \core\event\base::LEVEL_OTHER:
            default:
                return get_string('other', 'report_eventlist');
                break;
        }
    }
1091509
protected function getLevelName($level)
    {
        return in_array($level, self::$levels) ? array_search($level, self::$levels) : '--';
    }
1102695
public function levelToString($level)
    {
        $mapping = [
            self::LOG_LEVEL_DEBUG => 'debug',
            self::LOG_LEVEL_INFO => 'info',
            self::LOG_LEVEL_WARN => 'warn',
            self::LOG_LEVEL_ERROR => 'error',
            self::LOG_LEVEL_FATAL => 'fatal',
        ];
        return isset($mapping[$level]) ? $mapping[$level] : 'unknown';
    }
1120163
public function getEventSitePrettyPrint()
  {
    $eventSite = null;
    if ($this->event && $this->site) {
      if (strpos($this->event, $this->site) !== false) {
        // Event contains site.
        $eventSite = $this->event;
      } else {
        $eventSite = "$this->event, in $this->site";
      }
    } elseif ($this->event) {
      $eventSite = $this->event;
    } elseif ($this->site) {
      $eventSite = $this->site;
    }

    return $eventSite;
    }
918436
public function get_course_name(\context $context) {
        $courseid = $this->courseid;
        if (empty($courseid)) {
            return get_string('site');
        } else {
            try {
                $course = get_course($courseid);
                return format_string($course->fullname, true, array('context' => $context));
            } catch (\dml_exception $e) {
                return '-';
            }
        }
    }
710227
public function get_course(event_interface $event) {
        if (is_null($this->courses)) {
            $this->load_courses();
        }

        if ($course = $event->get_course()) {
            $courseid = $course->get('id');
            return isset($this->courses[$courseid]) ? $this->courses[$courseid] : null;
        } else {
            return null;
        }
    }
1152556
private function normalizeEvent($event)
    {
        if (is_object($event)) {
            $event = get_class($event);
        }

        if (preg_match('/^bootstrapp(ing|ed): /', $event)) {
            return $event;
        }

        // Events can be formatted as 'event.name: parameters'
        $segments = explode(':', $event);

        return $segments[0];
    }
426663
public static function toMonologLevel($level)
    {
        if (is_string($level) && defined(__CLASS__.'::'.strtoupper($level))) {
            return constant(__CLASS__.'::'.strtoupper($level));
        }

        return $level;
    }
1172866
public function get_url() {
        $params = [];
        if (isset($this->other['eventtype'])) {
            if ($this->other['eventtype'] == 'course' || $this->other['eventtype'] == 'group') {
                $params['course'] = $this->other['courseid'];
                if ($this->other['eventtype'] == 'group' && isset($this->other['groupid'])) {
                    $params['group'] = $this->other['groupid'];
                }
            }
            if ($this->other['eventtype'] == 'category' && isset($this->other['categoryid'])) {
                $params['category'] = $this->other['categoryid'];
            }
        } else {
            // This is a legacy event.
            // Prior to specification of the eventtype there were only two params.
            if (($this->other['courseid'] != SITEID) && ($this->other['courseid'] != 0)) {
                $params['course'] = $this->other['courseid'];
            }
        }
        return new \moodle_url('/calendar/managesubscriptions.php', $params);

    }
602047
public static function getLevelName($level)
    {
        $level = (int) $level;
        foreach (static::$levelNameToLevel as $levelName => $currentLevel) {
            if ($level >= $currentLevel) {
                return $levelName;
            }
        }

        return static::$levelNameToLevel[static::ALL];
    }
305798
public static function getLevelByName($level)
    {
        $level = strtoupper($level);
        if (!isset(static::$levelNameToLevel[$level])) {
            return static::ALL;
        }

        return static::$levelNameToLevel[$level];
    }
822559
public function getLanguageAbbr($iLanguage = null)
    {
        if ($this->_aLangAbbr === null) {
            $this->_aLangAbbr = $this->getLanguageIds();
        }

        $iLanguage = isset($iLanguage) ? (int) $iLanguage : $this->getBaseLanguage();
        if (isset($this->_aLangAbbr[$iLanguage])) {
            $iLanguage = $this->_aLangAbbr[$iLanguage];
        }

        return $iLanguage;
    }
982886
public static function getLevel($level = null) {

        $level = strtoupper($level);

        if ( array_key_exists($level, self::$levels) ) return self::$levels[$level];

        return self::$levels[self::DEFAULT_LOG_LEVEL];

    }
219282
public function get_enrol_info(stdClass $instance) {

        $instanceinfo = new stdClass();
        $instanceinfo->id = $instance->id;
        $instanceinfo->courseid = $instance->courseid;
        $instanceinfo->type = $this->get_name();
        $instanceinfo->name = $this->get_instance_name($instance);
        $instanceinfo->status = $instance->status == ENROL_INSTANCE_ENABLED;

        // Specifics enrolment method parameters.
        $instanceinfo->requiredparam = new stdClass();
        $instanceinfo->requiredparam->passwordrequired = !empty($instance->password);

        // If the plugin is enabled, return the URL for obtaining more information.
        if ($instanceinfo->status) {
            $instanceinfo->wsfunction = 'enrol_guest_get_instance_info';
        }
        return $instanceinfo;
    }
873759
protected function getEventName($event)
    {
        if (Assert::instanceOf($event, '\\One\\Event\\Event')) {
            return $event->getName();
        } elseif (Assert::string($event)) {
            return $event;
        }

        throw new InvalidArgumentException(
            '`Event` must be `string` or extends class `One\Event\Event`'
        );
    }
581596
protected function _getLogLevel($level) {
        switch ($level) {
            case xPDO::LOG_LEVEL_DEBUG :
                $levelText= 'DEBUG';
                break;
            case xPDO::LOG_LEVEL_INFO :
                $levelText= 'INFO';
                break;
            case xPDO::LOG_LEVEL_WARN :
                $levelText= 'WARN';
                break;
            case xPDO::LOG_LEVEL_ERROR :
                $levelText= 'ERROR';
                break;
            default :
                $levelText= 'FATAL';
        }
        return $levelText;
    }
608397
public static function get_allowed_event_types($courseid = 0) {

        $params = self::validate_parameters(self::get_allowed_event_types_parameters(), ['courseid' => $courseid]);

        if (empty($params['courseid']) || $params['courseid'] == SITEID) {
            $context = \context_system::instance();
        } else {
            $context = \context_course::instance($params['courseid']);
        }

        self::validate_context($context);

        $allowedeventtypes = array_filter(calendar_get_allowed_event_types($params['courseid']));

        return [
            'allowedeventtypes' => array_keys($allowedeventtypes),
            'warnings' => [],
        ];
    }