protected function isDeletable($object): bool
    {
        $em = $this->getEntityManager();
        $em->beginTransaction();
        try {
            // if an object is softdeleteable, then set 'deletedAt' first, so that a 'hard-delete' will be attempted.
            if ($object instanceof SoftDeleteableInterface) {
                $object->setDeletedAt(new \DateTime());
            }
            $em->remove($object);
            $em->flush();
            $em->rollback();
            return true;
        } catch (ForeignKeyConstraintViolationException $exception) {
            $em->rollback();
            return false;
        }
    }