original_string: protected function get_child_module($cm) {
          $cmid = is_object($cm) ? $cm->id : $cm;
          if (!array_key_exists($cmid, $this->childrenmodules)) {
              $this->childrenmodules[$cmid] = null;
              if (!($cm instanceof cm_info)) {
                  $cms = get_fast_modinfo($this->course)->cms;
                  $cm = array_key_exists($cmid, $cms) ? $cms[$cmid] : null;
              }
              if ($cm && $cm->uservisible) {
                  $this->childrenmodules[$cmid] = new file_info_context_module($this->browser,
                      $cm->context, $this->course, $cm, $cm->modname);
              }
          }
          return $this->childrenmodules[$cmid];
      }
code: protected function get_child_module($cm) {
          $cmid = is_object($cm) ? $cm->id : $cm;
          if (!array_key_exists($cmid, $this->childrenmodules)) {
              $this->childrenmodules[$cmid] = null;
              if (!($cm instanceof cm_info)) {
                  $cms = get_fast_modinfo($this->course)->cms;
                  $cm = array_key_exists($cmid, $cms) ? $cms[$cmid] : null;
              }
              if ($cm && $cm->uservisible) {
                  $this->childrenmodules[$cmid] = new file_info_context_module($this->browser,
                      $cm->context, $this->course, $cm, $cm->modname);
              }
          }
          return $this->childrenmodules[$cmid];
      }
code_tokens: protected function get_child_module ( $ cm ) { $ cmid = is_object ( $ cm ) ? $ cm -> id : $ cm ; if ( ! array_key_exists ( $ cmid , $ this -> childrenmodules ) ) { $ this -> childrenmodules [ $ cmid ] = null ; if ( ! ( $ cm instanceof cm_info ) ) { $ cms = get_fast_modinfo ( $ this -> course ) -> cms ; $ cm = array_key_exists ( $ cmid , $ cms ) ? $ cms [ $ cmid ] : null ; } if ( $ cm && $ cm -> uservisible ) { $ this -> childrenmodules [ $ cmid ] = new file_info_context_module ( $ this -> browser , $ cm -> context , $ this -> course , $ cm , $ cm -> modname ) ; } } return $ this -> childrenmodules [ $ cmid ] ; }
docstring: Returns the child module if it is accessible by the current user
  
  @param cm_info|int $cm
  @return file_info_context_module|null
docstring_tokens: Returns the child module if it is accessible by the current user