original_string: public static function get_related_question_usages_for_user(string $prefix, string $component, string $joinfield, int $userid) : \qubaid_join {
          return new \qubaid_join("
                  JOIN {question_usages} {$prefix}_qu ON {$prefix}_qu.id = {$joinfield}
                   AND {$prefix}_qu.component = :{$prefix}_usagecomponent
                  JOIN {question_attempts} {$prefix}_qa ON {$prefix}_qa.questionusageid = {$prefix}_qu.id
                  JOIN {question_attempt_steps} {$prefix}_qas ON {$prefix}_qas.questionattemptid = {$prefix}_qa.id",
              "{$prefix}_qu.id",
              "{$prefix}_qas.userid = :{$prefix}_stepuserid",
              [
                  "{$prefix}_stepuserid" => $userid,
                  "{$prefix}_usagecomponent" => $component,
              ]);
      }
code: public static function get_related_question_usages_for_user(string $prefix, string $component, string $joinfield, int $userid) : \qubaid_join {
          return new \qubaid_join("
                  JOIN {question_usages} {$prefix}_qu ON {$prefix}_qu.id = {$joinfield}
                   AND {$prefix}_qu.component = :{$prefix}_usagecomponent
                  JOIN {question_attempts} {$prefix}_qa ON {$prefix}_qa.questionusageid = {$prefix}_qu.id
                  JOIN {question_attempt_steps} {$prefix}_qas ON {$prefix}_qas.questionattemptid = {$prefix}_qa.id",
              "{$prefix}_qu.id",
              "{$prefix}_qas.userid = :{$prefix}_stepuserid",
              [
                  "{$prefix}_stepuserid" => $userid,
                  "{$prefix}_usagecomponent" => $component,
              ]);
      }
code_tokens: public static function get_related_question_usages_for_user ( string $ prefix , string $ component , string $ joinfield , int $ userid ) : \ qubaid_join { return new \ qubaid_join ( "
                  JOIN {question_usages} {$prefix}_qu ON {$prefix}_qu.id = {$joinfield}
                   AND {$prefix}_qu.component = :{$prefix}_usagecomponent
                  JOIN {question_attempts} {$prefix}_qa ON {$prefix}_qa.questionusageid = {$prefix}_qu.id
                  JOIN {question_attempt_steps} {$prefix}_qas ON {$prefix}_qas.questionattemptid = {$prefix}_qa.id" , "{$prefix}_qu.id" , "{$prefix}_qas.userid = :{$prefix}_stepuserid" , [ "{$prefix}_stepuserid" => $ userid , "{$prefix}_usagecomponent" => $ component , ] ) ; }
docstring: Determine related question usages for a user.
  
  @param   string          $prefix     A unique prefix to add to the table alias
  @param   string          $component  The name of the component to fetch usages for.
  @param   string          $joinfield  The SQL field name to use in the JOIN ON - e.g. q.usageid
  @param   int             $userid     The user to search.
  @return  \qubaid_join
docstring_tokens: Determine related question usages for a user .