I have a copy of the QGIS github project locally, it's a few months old but I was able to find where this changed.
It's worth checking the list of API changes, which mentions this
dataobjects.getLayerFromString() was removed. Use QgsProcessingUtils.mapLayerFromString() instead.
Using git line annotations I was able to trace this back to a change made a few months ago...
it looks as if a few methods (including getObject) were refactored out and replaced with a single getLayerFromString() method
def getLayerFromString(string, forceLoad=True):
"""Returns an object (layer/table) given a source definition.
if forceLoad is true, it tries to load it if it is not currently open
Otherwise, it will return the object only if it is loaded in QGIS.
But since then it's been moved to QgsProcessingUtils.
So you could try using
If using QGIS 2.x, you should still be able to use getObject() as before (can check using