original_string: public static function pack_reference($params) {
          $params = (array)$params;
          $reference = array();
          $reference['contextid'] = is_null($params['contextid']) ? null : clean_param($params['contextid'], PARAM_INT);
          $reference['component'] = is_null($params['component']) ? null : clean_param($params['component'], PARAM_COMPONENT);
          $reference['itemid']    = is_null($params['itemid'])    ? null : clean_param($params['itemid'],    PARAM_INT);
          $reference['filearea']  = is_null($params['filearea'])  ? null : clean_param($params['filearea'],  PARAM_AREA);
          $reference['filepath']  = is_null($params['filepath'])  ? null : clean_param($params['filepath'],  PARAM_PATH);
          $reference['filename']  = is_null($params['filename'])  ? null : clean_param($params['filename'],  PARAM_FILE);
          return base64_encode(serialize($reference));
      }
code: public static function pack_reference($params) {
          $params = (array)$params;
          $reference = array();
          $reference['contextid'] = is_null($params['contextid']) ? null : clean_param($params['contextid'], PARAM_INT);
          $reference['component'] = is_null($params['component']) ? null : clean_param($params['component'], PARAM_COMPONENT);
          $reference['itemid']    = is_null($params['itemid'])    ? null : clean_param($params['itemid'],    PARAM_INT);
          $reference['filearea']  = is_null($params['filearea'])  ? null : clean_param($params['filearea'],  PARAM_AREA);
          $reference['filepath']  = is_null($params['filepath'])  ? null : clean_param($params['filepath'],  PARAM_PATH);
          $reference['filename']  = is_null($params['filename'])  ? null : clean_param($params['filename'],  PARAM_FILE);
          return base64_encode(serialize($reference));
      }
code_tokens: public static function pack_reference ( $ params ) { $ params = ( array ) $ params ; $ reference = array ( ) ; $ reference [ 'contextid' ] = is_null ( $ params [ 'contextid' ] ) ? null : clean_param ( $ params [ 'contextid' ] , PARAM_INT ) ; $ reference [ 'component' ] = is_null ( $ params [ 'component' ] ) ? null : clean_param ( $ params [ 'component' ] , PARAM_COMPONENT ) ; $ reference [ 'itemid' ] = is_null ( $ params [ 'itemid' ] ) ? null : clean_param ( $ params [ 'itemid' ] , PARAM_INT ) ; $ reference [ 'filearea' ] = is_null ( $ params [ 'filearea' ] ) ? null : clean_param ( $ params [ 'filearea' ] , PARAM_AREA ) ; $ reference [ 'filepath' ] = is_null ( $ params [ 'filepath' ] ) ? null : clean_param ( $ params [ 'filepath' ] , PARAM_PATH ) ; $ reference [ 'filename' ] = is_null ( $ params [ 'filename' ] ) ? null : clean_param ( $ params [ 'filename' ] , PARAM_FILE ) ; return base64_encode ( serialize ( $ reference ) ) ; }
docstring: When user referring to a moodle file, we build the reference field
  
  @param array $params
  @return string
docstring_tokens: When user referring to a moodle file we build the reference field