original_string: public function get_user_enrolment_components($userenrolment) {
          global $DB;
          if (is_numeric($userenrolment)) {
              $userenrolment = $DB->get_record('user_enrolments', array('id'=>(int)$userenrolment));
          }
          $instances = $this->get_enrolment_instances();
          $plugins = $this->get_enrolment_plugins(false);
          if (!$userenrolment || !isset($instances[$userenrolment->enrolid])) {
              return array(false, false);
          }
          $instance = $instances[$userenrolment->enrolid];
          $plugin = $plugins[$instance->enrol];
          return array($instance, $plugin);
      }
code: public function get_user_enrolment_components($userenrolment) {
          global $DB;
          if (is_numeric($userenrolment)) {
              $userenrolment = $DB->get_record('user_enrolments', array('id'=>(int)$userenrolment));
          }
          $instances = $this->get_enrolment_instances();
          $plugins = $this->get_enrolment_plugins(false);
          if (!$userenrolment || !isset($instances[$userenrolment->enrolid])) {
              return array(false, false);
          }
          $instance = $instances[$userenrolment->enrolid];
          $plugin = $plugins[$instance->enrol];
          return array($instance, $plugin);
      }
code_tokens: public function get_user_enrolment_components ( $ userenrolment ) { global $ DB ; if ( is_numeric ( $ userenrolment ) ) { $ userenrolment = $ DB -> get_record ( 'user_enrolments' , array ( 'id' => ( int ) $ userenrolment ) ) ; } $ instances = $ this -> get_enrolment_instances ( ) ; $ plugins = $ this -> get_enrolment_plugins ( false ) ; if ( ! $ userenrolment || ! isset ( $ instances [ $ userenrolment -> enrolid ] ) ) { return array ( false , false ) ; } $ instance = $ instances [ $ userenrolment -> enrolid ] ; $ plugin = $ plugins [ $ instance -> enrol ] ; return array ( $ instance , $ plugin ) ; }
docstring: Given a user enrolment record this method returns the plugin and enrolment
  instance that relate to it.
  
  @param stdClass|int $userenrolment
  @return array array($instance, $plugin)
docstring_tokens: Given a user enrolment record this method returns the plugin and enrolment instance that relate to it .