original_string: public function onGetNewsModules()
      {
          $modules = [];
          $records = $this->db->fetchAll("SELECT m.id, m.name, t.name AS theme FROM tl_module m LEFT JOIN tl_theme t ON m.pid=t.id WHERE m.type IN ('newslist', 'newsarchive') ORDER BY t.name, m.name");
  
          foreach ($records as $record) {
              $modules[$record['theme']][$record['id']] = \sprintf('%s (ID %s)', $record['name'], $record['id']);
          }
  
          return $modules;
      }
code: public function onGetNewsModules()
      {
          $modules = [];
          $records = $this->db->fetchAll("SELECT m.id, m.name, t.name AS theme FROM tl_module m LEFT JOIN tl_theme t ON m.pid=t.id WHERE m.type IN ('newslist', 'newsarchive') ORDER BY t.name, m.name");
  
          foreach ($records as $record) {
              $modules[$record['theme']][$record['id']] = \sprintf('%s (ID %s)', $record['name'], $record['id']);
          }
  
          return $modules;
      }
code_tokens: public function onGetNewsModules ( ) { $ modules = [ ] ; $ records = $ this -> db -> fetchAll ( "SELECT m.id, m.name, t.name AS theme FROM tl_module m LEFT JOIN tl_theme t ON m.pid=t.id WHERE m.type IN ('newslist', 'newsarchive') ORDER BY t.name, m.name" ) ; foreach ( $ records as $ record ) { $ modules [ $ record [ 'theme' ] ] [ $ record [ 'id' ] ] = \ sprintf ( '%s (ID %s)' , $ record [ 'name' ] , $ record [ 'id' ] ) ; } return $ modules ; }
docstring: Get news modules and return them as array.
  
  @return array
docstring_tokens: Get news modules and return them as array .