protected function validateUndeleteResource(ResourceInterface $resource, $type): void
    {
        if (static::TYPE_UNDELETE === $type) {
            $object = $resource->getRealData();

            if ($object instanceof SoftDeletableInterface) {
                $object->setDeletedAt();
            } else {
                DomainUtil::addResourceError($resource, $this->translator->trans('domain.resource_type_not_undeleted', [], 'FxpResource'));
            }
        }
    }