original_string: public static function read_plan($id) {
          static::require_enabled();
          $plan = new plan($id);
  
          if (!$plan->can_read()) {
              $context = context_user::instance($plan->get('userid'));
              throw new required_capability_exception($context, 'moodle/competency:planview', 'nopermissions', '');
          }
  
          return $plan;
      }
code: public static function read_plan($id) {
          static::require_enabled();
          $plan = new plan($id);
  
          if (!$plan->can_read()) {
              $context = context_user::instance($plan->get('userid'));
              throw new required_capability_exception($context, 'moodle/competency:planview', 'nopermissions', '');
          }
  
          return $plan;
      }
code_tokens: public static function read_plan ( $ id ) { static :: require_enabled ( ) ; $ plan = new plan ( $ id ) ; if ( ! $ plan -> can_read ( ) ) { $ context = context_user :: instance ( $ plan -> get ( 'userid' ) ) ; throw new required_capability_exception ( $ context , 'moodle/competency:planview' , 'nopermissions' , '' ) ; } return $ plan ; }
docstring: Returns a plan data.
  
  @param int $id
  @return \core_competency\plan
docstring_tokens: Returns a plan data .