original_string: protected static function get_retention_display_text(purpose $effectivepurpose, $retentioncontextlevel, \context $context) {
          global $PAGE;
  
          $renderer = $PAGE->get_renderer('tool_dataprivacy');
  
          $exporter = new \tool_dataprivacy\external\purpose_exporter($effectivepurpose, ['context' => $context]);
          $exportedpurpose = $exporter->export($renderer);
  
          switch ($retentioncontextlevel) {
              case CONTEXT_COURSE:
              case CONTEXT_MODULE:
              case CONTEXT_BLOCK:
                  $str = get_string('effectiveretentionperiodcourse', 'tool_dataprivacy',
                      $exportedpurpose->formattedretentionperiod);
                  break;
              case CONTEXT_USER:
                  $str = get_string('effectiveretentionperioduser', 'tool_dataprivacy',
                      $exportedpurpose->formattedretentionperiod);
                  break;
              default:
                  $str = $exportedpurpose->formattedretentionperiod;
          }
  
          return $str;
      }
code: protected static function get_retention_display_text(purpose $effectivepurpose, $retentioncontextlevel, \context $context) {
          global $PAGE;
  
          $renderer = $PAGE->get_renderer('tool_dataprivacy');
  
          $exporter = new \tool_dataprivacy\external\purpose_exporter($effectivepurpose, ['context' => $context]);
          $exportedpurpose = $exporter->export($renderer);
  
          switch ($retentioncontextlevel) {
              case CONTEXT_COURSE:
              case CONTEXT_MODULE:
              case CONTEXT_BLOCK:
                  $str = get_string('effectiveretentionperiodcourse', 'tool_dataprivacy',
                      $exportedpurpose->formattedretentionperiod);
                  break;
              case CONTEXT_USER:
                  $str = get_string('effectiveretentionperioduser', 'tool_dataprivacy',
                      $exportedpurpose->formattedretentionperiod);
                  break;
              default:
                  $str = $exportedpurpose->formattedretentionperiod;
          }
  
          return $str;
      }
code_tokens: protected static function get_retention_display_text ( purpose $ effectivepurpose , $ retentioncontextlevel , \ context $ context ) { global $ PAGE ; $ renderer = $ PAGE -> get_renderer ( 'tool_dataprivacy' ) ; $ exporter = new \ tool_dataprivacy \ external \ purpose_exporter ( $ effectivepurpose , [ 'context' => $ context ] ) ; $ exportedpurpose = $ exporter -> export ( $ renderer ) ; switch ( $ retentioncontextlevel ) { case CONTEXT_COURSE : case CONTEXT_MODULE : case CONTEXT_BLOCK : $ str = get_string ( 'effectiveretentionperiodcourse' , 'tool_dataprivacy' , $ exportedpurpose -> formattedretentionperiod ) ; break ; case CONTEXT_USER : $ str = get_string ( 'effectiveretentionperioduser' , 'tool_dataprivacy' , $ exportedpurpose -> formattedretentionperiod ) ; break ; default : $ str = $ exportedpurpose -> formattedretentionperiod ; } return $ str ; }
docstring: Returns the purpose display text.
  
  @param purpose $effectivepurpose
  @param int $retentioncontextlevel
  @param \context $context The context, just for displaying (filters) purposes.
  @return string
docstring_tokens: Returns the purpose display text .