original_string: public function get_enrolment_instance_names($onlyenabled = false) {
          if ($this->_inames === null) {
              $instances = $this->get_enrolment_instances($onlyenabled);
              $plugins = $this->get_enrolment_plugins(false);
              foreach ($instances as $key=>$instance) {
                  if (!isset($plugins[$instance->enrol])) {
                      // weird, some broken stuff in plugin
                      unset($instances[$key]);
                      continue;
                  }
                  $this->_inames[$key] = $plugins[$instance->enrol]->get_instance_name($instance);
              }
          }
          return $this->_inames;
      }
code: public function get_enrolment_instance_names($onlyenabled = false) {
          if ($this->_inames === null) {
              $instances = $this->get_enrolment_instances($onlyenabled);
              $plugins = $this->get_enrolment_plugins(false);
              foreach ($instances as $key=>$instance) {
                  if (!isset($plugins[$instance->enrol])) {
                      // weird, some broken stuff in plugin
                      unset($instances[$key]);
                      continue;
                  }
                  $this->_inames[$key] = $plugins[$instance->enrol]->get_instance_name($instance);
              }
          }
          return $this->_inames;
      }
code_tokens: public function get_enrolment_instance_names ( $ onlyenabled = false ) { if ( $ this -> _inames === null ) { $ instances = $ this -> get_enrolment_instances ( $ onlyenabled ) ; $ plugins = $ this -> get_enrolment_plugins ( false ) ; foreach ( $ instances as $ key => $ instance ) { if ( ! isset ( $ plugins [ $ instance -> enrol ] ) ) { // weird, some broken stuff in plugin unset ( $ instances [ $ key ] ) ; continue ; } $ this -> _inames [ $ key ] = $ plugins [ $ instance -> enrol ] -> get_instance_name ( $ instance ) ; } } return $ this -> _inames ; }
docstring: Returns the names for all of the enrolment instances for this course.
  
  @param bool $onlyenabled Whether to return data from enabled enrolment instance names only.
  @return array
docstring_tokens: Returns the names for all of the enrolment instances for this course .