Issue #3469454 by pbonnefoi: Get rid of magic method in getParentEntity to make it mockable for UnitTest
Closes #3469454