private function getRecordsByHandle(array $records): array
    {
        $recordsByHandle = [];
        foreach ($records as $record) {
            $modelClass = get_class($record);
            $converter = Craft::$app->controller->module->getConverter($modelClass);
            $index = $converter->getRecordIndex($record);
            $recordsByHandle[$index] = $record;
        }

        return $recordsByHandle;
    }
private function getRecordsByHandle(array $records): array
    {
        $recordsByHandle = [];
        foreach ($records as $record) {
            $modelClass = get_class($record);
            $converter = Craft::$app->controller->module->getConverter($modelClass);
            $index = $converter->getRecordIndex($record);
            $recordsByHandle[$index] = $record;
        }

        return $recordsByHandle;
    }
private function getRecordsByHandle ( array $ records ) : array { $ recordsByHandle = [ ] ; foreach ( $ records as $ record ) { $ modelClass = get_class ( $ record ) ; $ converter = Craft :: $ app -> controller -> module -> getConverter ( $ modelClass ) ; $ index = $ converter -> getRecordIndex ( $ record ) ; $ recordsByHandle [ $ index ] = $ record ; } return $ recordsByHandle ; }
Get records by handle.

@param array $records

@return array
Get records by handle .