original_string: private function get_favourite_sql(int $userid): array {
  
          $usercontext = \context_user::instance($userid);
          $alias = $this->get_table_alias();
          $ufservice = \core_favourites\service_factory::get_service_for_user_context($usercontext);
          list($favsql, $favparams) = $ufservice->get_join_sql_by_type('mod_forum', 'discussions',
              $this->get_favourite_alias(), "$alias.id");
  
          return [$favsql, $favparams];
      }
code: private function get_favourite_sql(int $userid): array {
  
          $usercontext = \context_user::instance($userid);
          $alias = $this->get_table_alias();
          $ufservice = \core_favourites\service_factory::get_service_for_user_context($usercontext);
          list($favsql, $favparams) = $ufservice->get_join_sql_by_type('mod_forum', 'discussions',
              $this->get_favourite_alias(), "$alias.id");
  
          return [$favsql, $favparams];
      }
code_tokens: private function get_favourite_sql ( int $ userid ) : array { $ usercontext = \ context_user :: instance ( $ userid ) ; $ alias = $ this -> get_table_alias ( ) ; $ ufservice = \ core_favourites \ service_factory :: get_service_for_user_context ( $ usercontext ) ; list ( $ favsql , $ favparams ) = $ ufservice -> get_join_sql_by_type ( 'mod_forum' , 'discussions' , $ this -> get_favourite_alias ( ) , "$alias.id" ) ; return [ $ favsql , $ favparams ] ; }
docstring: Get the standard favouriting sql.
  
  @param int $userid The ID of the user we are getting the sql for
  @return [$sql, $params] An array comprising of the sql and any associated params
docstring_tokens: Get the standard favouriting sql .