original_string: public static function get_user_subscriptions_for_course($courseid, $limitfrom = 0, $limitto = 0, $userid = 0,
              $order = 's.timecreated DESC' ) {
          global $DB, $USER;
          if ($userid == 0) {
              $userid = $USER->id;
          }
          $sql = self::get_subscription_join_rule_sql();
          $sql .= "WHERE s.courseid = :courseid AND s.userid = :userid ORDER BY $order";
  
          return self::get_instances($DB->get_records_sql($sql, array('courseid' => $courseid, 'userid' => $userid), $limitfrom,
                  $limitto));
      }
code: public static function get_user_subscriptions_for_course($courseid, $limitfrom = 0, $limitto = 0, $userid = 0,
              $order = 's.timecreated DESC' ) {
          global $DB, $USER;
          if ($userid == 0) {
              $userid = $USER->id;
          }
          $sql = self::get_subscription_join_rule_sql();
          $sql .= "WHERE s.courseid = :courseid AND s.userid = :userid ORDER BY $order";
  
          return self::get_instances($DB->get_records_sql($sql, array('courseid' => $courseid, 'userid' => $userid), $limitfrom,
                  $limitto));
      }
code_tokens: public static function get_user_subscriptions_for_course ( $ courseid , $ limitfrom = 0 , $ limitto = 0 , $ userid = 0 , $ order = 's.timecreated DESC' ) { global $ DB , $ USER ; if ( $ userid == 0 ) { $ userid = $ USER -> id ; } $ sql = self :: get_subscription_join_rule_sql ( ) ; $ sql .= "WHERE s.courseid = :courseid AND s.userid = :userid ORDER BY $order" ; return self :: get_instances ( $ DB -> get_records_sql ( $ sql , array ( 'courseid' => $ courseid , 'userid' => $ userid ) , $ limitfrom , $ limitto ) ) ; }
docstring: Get an array of subscriptions for a given user in a given course.
  
  @param int $courseid course id.
  @param int $limitfrom Limit from which to fetch rules.
  @param int $limitto  Limit to which rules need to be fetched.
  @param int $userid Id of the user for which the subscription needs to be fetched. Defaults to $USER;
  @param string $order Order to sort the subscriptions.
  
  @return array list of subscriptions
docstring_tokens: Get an array of subscriptions for a given user in a given course .