Domain/Domain.php
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'));
            }
        }
    }
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'));
            }
        }
    }
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' ) ) ; } } }
Validate the resource only when type is undelete.

@param ResourceInterface $resource The resource
@param int               $type     The type of persist action
Validate the resource only when type is undelete .