original_string: public static function get_enabled_tourdata() {
          global $DB;
  
          $cache = \cache::make('tool_usertours', self::CACHENAME_TOUR);
  
          $data = $cache->get(self::CACHEKEY_TOUR);
          if ($data === false) {
              $sql = <<<EOF
                  SELECT t.*
                    FROM {tool_usertours_tours} t
                   WHERE t.enabled = 1
                     AND t.id IN (SELECT s.tourid FROM {tool_usertours_steps} s GROUP BY s.tourid)
                ORDER BY t.sortorder ASC
  EOF;
  
              $data = $DB->get_records_sql($sql);
              $cache->set('tours', $data);
          }
  
          return $data;
      }
code: public static function get_enabled_tourdata() {
          global $DB;
  
          $cache = \cache::make('tool_usertours', self::CACHENAME_TOUR);
  
          $data = $cache->get(self::CACHEKEY_TOUR);
          if ($data === false) {
              $sql = <<<EOF
                  SELECT t.*
                    FROM {tool_usertours_tours} t
                   WHERE t.enabled = 1
                     AND t.id IN (SELECT s.tourid FROM {tool_usertours_steps} s GROUP BY s.tourid)
                ORDER BY t.sortorder ASC
  EOF;
  
              $data = $DB->get_records_sql($sql);
              $cache->set('tours', $data);
          }
  
          return $data;
      }
code_tokens: public static function get_enabled_tourdata ( ) { global $ DB ; $ cache = \ cache :: make ( 'tool_usertours' , self :: CACHENAME_TOUR ) ; $ data = $ cache -> get ( self :: CACHEKEY_TOUR ) ; if ( $ data === false ) { $ sql =  <<<EOF
                  SELECT t.*
                    FROM {tool_usertours_tours} t
                   WHERE t.enabled = 1
                     AND t.id IN (SELECT s.tourid FROM {tool_usertours_steps} s GROUP BY s.tourid)
                ORDER BY t.sortorder ASC
  EOF ; $ data = $ DB -> get_records_sql ( $ sql ) ; $ cache -> set ( 'tours' , $ data ) ; } return $ data ; }
docstring: Fetch all enabled tours.
docstring_tokens: Fetch all enabled tours .