Invert the order of ids and type in getObjects()