Type casting for DoctrineEntityEvent