original_string: public static function read_plan($id) {
          global $PAGE;
  
          $params = self::validate_parameters(self::read_plan_parameters(), array(
              'id' => $id,
          ));
  
          $plan = api::read_plan($params['id']);
          self::validate_context($plan->get_context());
          $output = $PAGE->get_renderer('core');
  
          $exporter = new plan_exporter($plan, array('template' => $plan->get_template()));
          $record = $exporter->export($output);
          return external_api::clean_returnvalue(self::read_plan_returns(), $record);
      }
code: public static function read_plan($id) {
          global $PAGE;
  
          $params = self::validate_parameters(self::read_plan_parameters(), array(
              'id' => $id,
          ));
  
          $plan = api::read_plan($params['id']);
          self::validate_context($plan->get_context());
          $output = $PAGE->get_renderer('core');
  
          $exporter = new plan_exporter($plan, array('template' => $plan->get_template()));
          $record = $exporter->export($output);
          return external_api::clean_returnvalue(self::read_plan_returns(), $record);
      }
code_tokens: public static function read_plan ( $ id ) { global $ PAGE ; $ params = self :: validate_parameters ( self :: read_plan_parameters ( ) , array ( 'id' => $ id , ) ) ; $ plan = api :: read_plan ( $ params [ 'id' ] ) ; self :: validate_context ( $ plan -> get_context ( ) ) ; $ output = $ PAGE -> get_renderer ( 'core' ) ; $ exporter = new plan_exporter ( $ plan , array ( 'template' => $ plan -> get_template ( ) ) ) ; $ record = $ exporter -> export ( $ output ) ; return external_api :: clean_returnvalue ( self :: read_plan_returns ( ) , $ record ) ; }
docstring: Read a plan by id.
  
  @param int $id The id of the plan.
  @return \stdClass
docstring_tokens: Read a plan by id .