Domain/Domain.php
protected function prepareDeleteResource(ResourceInterface $resource, $autoCommit, $hasError, $hasFlushError)
    {
        $continue = false;

        if (!$autoCommit && $hasError) {
            $resource->setStatus(ResourceStatutes::CANCELED);
            $continue = true;
        } elseif ($autoCommit && $hasFlushError && $hasError) {
            DomainUtil::addResourceError($resource, $this->translator->trans('domain.database_previous_error', [], 'FxpResource'));
            $continue = true;
        } elseif (null !== $idError = $this->getErrorIdentifier($resource->getRealData(), static::TYPE_DELETE)) {
            $hasError = true;
            $resource->setStatus(ResourceStatutes::ERROR);
            $resource->getErrors()->add(new ConstraintViolation($idError, $idError, [], $resource->getRealData(), null, null));
            $continue = true;
        }

        return [$continue, $hasError];
    }
protected function prepareDeleteResource(ResourceInterface $resource, $autoCommit, $hasError, $hasFlushError)
    {
        $continue = false;

        if (!$autoCommit && $hasError) {
            $resource->setStatus(ResourceStatutes::CANCELED);
            $continue = true;
        } elseif ($autoCommit && $hasFlushError && $hasError) {
            DomainUtil::addResourceError($resource, $this->translator->trans('domain.database_previous_error', [], 'FxpResource'));
            $continue = true;
        } elseif (null !== $idError = $this->getErrorIdentifier($resource->getRealData(), static::TYPE_DELETE)) {
            $hasError = true;
            $resource->setStatus(ResourceStatutes::ERROR);
            $resource->getErrors()->add(new ConstraintViolation($idError, $idError, [], $resource->getRealData(), null, null));
            $continue = true;
        }

        return [$continue, $hasError];
    }
protected function prepareDeleteResource ( ResourceInterface $ resource , $ autoCommit , $ hasError , $ hasFlushError ) { $ continue = false ; if ( ! $ autoCommit && $ hasError ) { $ resource -> setStatus ( ResourceStatutes :: CANCELED ) ; $ continue = true ; } elseif ( $ autoCommit && $ hasFlushError && $ hasError ) { DomainUtil :: addResourceError ( $ resource , $ this -> translator -> trans ( 'domain.database_previous_error' , [ ] , 'FxpResource' ) ) ; $ continue = true ; } elseif ( null !== $ idError = $ this -> getErrorIdentifier ( $ resource -> getRealData ( ) , static :: TYPE_DELETE ) ) { $ hasError = true ; $ resource -> setStatus ( ResourceStatutes :: ERROR ) ; $ resource -> getErrors ( ) -> add ( new ConstraintViolation ( $ idError , $ idError , [ ] , $ resource -> getRealData ( ) , null , null ) ) ; $ continue = true ; } return [ $ continue , $ hasError ] ; }
Prepare the deletion of resource.

@param ResourceInterface $resource      The resource
@param bool              $autoCommit    Commit transaction for each resource or all
(continue the action even if there is an error on a resource)
@param bool              $hasError      Check if there is an previous error
@param bool              $hasFlushError Check if there is an previous flush error

@return array The check if the delete action must be continued and check if there is an error
Prepare the deletion of resource .