original_string: protected function get_course_areas($extensions = '*', $returnemptyfolders = false) {
          global $DB;
  
          $allareas = [
              'course_summary',
              'course_overviewfiles',
              'course_section',
              'backup_section',
              'backup_course',
              'backup_automated',
              'course_legacy'
          ];
  
          if ($returnemptyfolders) {
              return $allareas;
          }
  
          $params1 = ['contextid' => $this->context->id, 'emptyfilename' => '.'];
          $sql1 = "SELECT " . $DB->sql_concat('f.component', "'_'", 'f.filearea') . "
              FROM {files} f
              WHERE f.filename <> :emptyfilename AND f.contextid = :contextid ";
          $sql3 = ' GROUP BY f.component, f.filearea';
          list($sql2, $params2) = $this->build_search_files_sql($extensions);
          $areaswithfiles = $DB->get_fieldset_sql($sql1 . $sql2 . $sql3, array_merge($params1, $params2));
  
          return array_intersect($allareas, $areaswithfiles);
      }
code: protected function get_course_areas($extensions = '*', $returnemptyfolders = false) {
          global $DB;
  
          $allareas = [
              'course_summary',
              'course_overviewfiles',
              'course_section',
              'backup_section',
              'backup_course',
              'backup_automated',
              'course_legacy'
          ];
  
          if ($returnemptyfolders) {
              return $allareas;
          }
  
          $params1 = ['contextid' => $this->context->id, 'emptyfilename' => '.'];
          $sql1 = "SELECT " . $DB->sql_concat('f.component', "'_'", 'f.filearea') . "
              FROM {files} f
              WHERE f.filename <> :emptyfilename AND f.contextid = :contextid ";
          $sql3 = ' GROUP BY f.component, f.filearea';
          list($sql2, $params2) = $this->build_search_files_sql($extensions);
          $areaswithfiles = $DB->get_fieldset_sql($sql1 . $sql2 . $sql3, array_merge($params1, $params2));
  
          return array_intersect($allareas, $areaswithfiles);
      }
code_tokens: protected function get_course_areas ( $ extensions = '*' , $ returnemptyfolders = false ) { global $ DB ; $ allareas = [ 'course_summary' , 'course_overviewfiles' , 'course_section' , 'backup_section' , 'backup_course' , 'backup_automated' , 'course_legacy' ] ; if ( $ returnemptyfolders ) { return $ allareas ; } $ params1 = [ 'contextid' => $ this -> context -> id , 'emptyfilename' => '.' ] ; $ sql1 = "SELECT " . $ DB -> sql_concat ( 'f.component' , "'_'" , 'f.filearea' ) . "
              FROM {files} f
              WHERE f.filename <> :emptyfilename AND f.contextid = :contextid " ; $ sql3 = ' GROUP BY f.component, f.filearea' ; list ( $ sql2 , $ params2 ) = $ this -> build_search_files_sql ( $ extensions ) ; $ areaswithfiles = $ DB -> get_fieldset_sql ( $ sql1 . $ sql2 . $ sql3 , array_merge ( $ params1 , $ params2 ) ) ; return array_intersect ( $ allareas , $ areaswithfiles ) ; }
docstring: Returns list of areas inside this course
  
  @param string $extensions Only return areas that have files with these extensions
  @param bool $returnemptyfolders return all areas always, if true it will ignore the previous argument
  @return array
docstring_tokens: Returns list of areas inside this course