Issue #2474501 by rszrama: switch to using the getBundle() property to determine entity types via the metadata wrapper.