original_string: private function obtain_view_data() {
          if ($this->state >= self::STATE_BUILDING_VIEW || $this->modinfo->get_user_id() == -1) {
              return;
          }
          $this->obtain_dynamic_data();
          $this->state = self::STATE_BUILDING_VIEW;
  
          // Let module make changes at this point
          $this->call_mod_function('cm_info_view');
          $this->state = self::STATE_VIEW;
      }
code: private function obtain_view_data() {
          if ($this->state >= self::STATE_BUILDING_VIEW || $this->modinfo->get_user_id() == -1) {
              return;
          }
          $this->obtain_dynamic_data();
          $this->state = self::STATE_BUILDING_VIEW;
  
          // Let module make changes at this point
          $this->call_mod_function('cm_info_view');
          $this->state = self::STATE_VIEW;
      }
code_tokens: private function obtain_view_data ( ) { if ( $ this -> state >= self :: STATE_BUILDING_VIEW || $ this -> modinfo -> get_user_id ( ) == - 1 ) { return ; } $ this -> obtain_dynamic_data ( ) ; $ this -> state = self :: STATE_BUILDING_VIEW ; // Let module make changes at this point $ this -> call_mod_function ( 'cm_info_view' ) ; $ this -> state = self :: STATE_VIEW ; }
docstring: If view data for this course-module is not yet available, obtains it.
  
  This function is automatically called if any of the functions (marked) which require
  view data are called.
  
  View data is data which is needed only for displaying the course main page (& any similar
  functionality on other pages) but is not needed in general. Obtaining view data may have
  a performance cost.
  
  As part of this function, the module's _cm_info_view function from its lib.php will
  be called (if it exists).
  @return void
docstring_tokens: If view data for this course - module is not yet available obtains it .