original_string: public static function get_many(array $ids) {
          global $DB;
          $coursecatrecordcache = cache::make('core', 'coursecatrecords');
          $categories = $coursecatrecordcache->get_many($ids);
          $toload = array();
          foreach ($categories as $id => $result) {
              if ($result === false) {
                  $toload[] = $id;
              }
          }
          if (!empty($toload)) {
              list($where, $params) = $DB->get_in_or_equal($toload, SQL_PARAMS_NAMED);
              $records = self::get_records('cc.id '.$where, $params);
              $toset = array();
              foreach ($records as $record) {
                  $categories[$record->id] = new self($record);
                  $toset[$record->id] = $categories[$record->id];
              }
              $coursecatrecordcache->set_many($toset);
          }
          return $categories;
      }
code: public static function get_many(array $ids) {
          global $DB;
          $coursecatrecordcache = cache::make('core', 'coursecatrecords');
          $categories = $coursecatrecordcache->get_many($ids);
          $toload = array();
          foreach ($categories as $id => $result) {
              if ($result === false) {
                  $toload[] = $id;
              }
          }
          if (!empty($toload)) {
              list($where, $params) = $DB->get_in_or_equal($toload, SQL_PARAMS_NAMED);
              $records = self::get_records('cc.id '.$where, $params);
              $toset = array();
              foreach ($records as $record) {
                  $categories[$record->id] = new self($record);
                  $toset[$record->id] = $categories[$record->id];
              }
              $coursecatrecordcache->set_many($toset);
          }
          return $categories;
      }
code_tokens: public static function get_many ( array $ ids ) { global $ DB ; $ coursecatrecordcache = cache :: make ( 'core' , 'coursecatrecords' ) ; $ categories = $ coursecatrecordcache -> get_many ( $ ids ) ; $ toload = array ( ) ; foreach ( $ categories as $ id => $ result ) { if ( $ result === false ) { $ toload [ ] = $ id ; } } if ( ! empty ( $ toload ) ) { list ( $ where , $ params ) = $ DB -> get_in_or_equal ( $ toload , SQL_PARAMS_NAMED ) ; $ records = self :: get_records ( 'cc.id ' . $ where , $ params ) ; $ toset = array ( ) ; foreach ( $ records as $ record ) { $ categories [ $ record -> id ] = new self ( $ record ) ; $ toset [ $ record -> id ] = $ categories [ $ record -> id ] ; } $ coursecatrecordcache -> set_many ( $ toset ) ; } return $ categories ; }
docstring: Load many core_course_category objects.
  
  @param array $ids An array of category ID's to load.
  @return core_course_category[]
docstring_tokens: Load many core_course_category objects .