public static function getScheduledEntityDeletionsByClassname(EntityManager $em, $classnames)
    {
        $entities = array();
        $classnames = (array) $classnames;

        foreach ($em->getUnitOfWork()->getScheduledEntityDeletions() as $entity) {
            if (true === in_array(ClassUtils::getRealClass($entity), $classnames)) {
                $entities[] = $entity;
            }
        }

        return $entities;
    }