original_string: public static function get_action_events_by_timesort(
          $timesortfrom = null,
          $timesortto = null,
          $aftereventid = null,
          $limitnum = 20,
          $limittononsuspendedevents = false,
          ?\stdClass $user = null
      ) {
          global $USER;
  
          if (!$user) {
              $user = $USER;
          }
  
          if (is_null($timesortfrom) && is_null($timesortto)) {
              throw new \moodle_exception("Must provide a timesort to and/or from value");
          }
  
          if ($limitnum < 1 || $limitnum > 50) {
              throw new \moodle_exception("Limit must be between 1 and 50 (inclusive)");
          }
  
          \core_calendar\local\event\container::set_requesting_user($user->id);
          $vault = \core_calendar\local\event\container::get_event_vault();
  
          $afterevent = null;
          if ($aftereventid && $event = $vault->get_event_by_id($aftereventid)) {
              $afterevent = $event;
          }
  
          return $vault->get_action_events_by_timesort($user, $timesortfrom, $timesortto, $afterevent, $limitnum,
                  $limittononsuspendedevents);
      }
code: public static function get_action_events_by_timesort(
          $timesortfrom = null,
          $timesortto = null,
          $aftereventid = null,
          $limitnum = 20,
          $limittononsuspendedevents = false,
          ?\stdClass $user = null
      ) {
          global $USER;
  
          if (!$user) {
              $user = $USER;
          }
  
          if (is_null($timesortfrom) && is_null($timesortto)) {
              throw new \moodle_exception("Must provide a timesort to and/or from value");
          }
  
          if ($limitnum < 1 || $limitnum > 50) {
              throw new \moodle_exception("Limit must be between 1 and 50 (inclusive)");
          }
  
          \core_calendar\local\event\container::set_requesting_user($user->id);
          $vault = \core_calendar\local\event\container::get_event_vault();
  
          $afterevent = null;
          if ($aftereventid && $event = $vault->get_event_by_id($aftereventid)) {
              $afterevent = $event;
          }
  
          return $vault->get_action_events_by_timesort($user, $timesortfrom, $timesortto, $afterevent, $limitnum,
                  $limittononsuspendedevents);
      }
code_tokens: public static function get_action_events_by_timesort ( $ timesortfrom = null , $ timesortto = null , $ aftereventid = null , $ limitnum = 20 , $ limittononsuspendedevents = false , ? \ stdClass $ user = null ) { global $ USER ; if ( ! $ user ) { $ user = $ USER ; } if ( is_null ( $ timesortfrom ) && is_null ( $ timesortto ) ) { throw new \ moodle_exception ( "Must provide a timesort to and/or from value" ) ; } if ( $ limitnum < 1 || $ limitnum > 50 ) { throw new \ moodle_exception ( "Limit must be between 1 and 50 (inclusive)" ) ; } \ core_calendar \ local \ event \ container :: set_requesting_user ( $ user -> id ) ; $ vault = \ core_calendar \ local \ event \ container :: get_event_vault ( ) ; $ afterevent = null ; if ( $ aftereventid && $ event = $ vault -> get_event_by_id ( $ aftereventid ) ) { $ afterevent = $ event ; } return $ vault -> get_action_events_by_timesort ( $ user , $ timesortfrom , $ timesortto , $ afterevent , $ limitnum , $ limittononsuspendedevents ) ; }
docstring: Get a list of action events for the logged in user by the given
  timesort values.
  
  @param int|null $timesortfrom The start timesort value (inclusive)
  @param int|null $timesortto The end timesort value (inclusive)
  @param int|null $aftereventid Only return events after this one
  @param int $limitnum Limit results to this amount (between 1 and 50)
  @param bool $lmittononsuspendedevents Limit course events to courses the user is active in (not suspended).
  @param \stdClass|null $user The user id or false for $USER
  @return array A list of action_event_interface objects
  @throws \moodle_exception
docstring_tokens: Get a list of action events for the logged in user by the given timesort values .