original_string: public static function get_subscription($subscriptionorid) {
          global $DB;
  
          if (is_object($subscriptionorid)) {
              return new subscription($subscriptionorid);
          }
  
          $sql = self::get_subscription_join_rule_sql();
          $sql .= "WHERE s.id = :id";
          $sub = $DB->get_record_sql($sql, array('id' => $subscriptionorid), MUST_EXIST);
          return new subscription($sub);
      }
code: public static function get_subscription($subscriptionorid) {
          global $DB;
  
          if (is_object($subscriptionorid)) {
              return new subscription($subscriptionorid);
          }
  
          $sql = self::get_subscription_join_rule_sql();
          $sql .= "WHERE s.id = :id";
          $sub = $DB->get_record_sql($sql, array('id' => $subscriptionorid), MUST_EXIST);
          return new subscription($sub);
      }
code_tokens: public static function get_subscription ( $ subscriptionorid ) { global $ DB ; if ( is_object ( $ subscriptionorid ) ) { return new subscription ( $ subscriptionorid ) ; } $ sql = self :: get_subscription_join_rule_sql ( ) ; $ sql .= "WHERE s.id = :id" ; $ sub = $ DB -> get_record_sql ( $ sql , array ( 'id' => $ subscriptionorid ) , MUST_EXIST ) ; return new subscription ( $ sub ) ; }
docstring: Get a subscription instance for an given subscription id.
  
  @param subscription|int $subscriptionorid an instance of subscription class or id.
  
  @return subscription returns a instance of subscription class.
docstring_tokens: Get a subscription instance for an given subscription id .