Removed magic if from IdentifiedEntity::getId